| Index: third_party/polymer/v1_0/components-chromium/app-route/app-route.html
|
| diff --git a/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-route.html b/third_party/polymer/v1_0/components-chromium/app-route/app-route.html
|
| similarity index 59%
|
| rename from third_party/polymer/v1_0/components-chromium/carbon-route/carbon-route.html
|
| rename to third_party/polymer/v1_0/components-chromium/app-route/app-route.html
|
| index dd311feab2c11568921bb066257577c2a8f09076..f9126fc9587d28aad8fddc2ea8f403dd9d0700d6 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-route.html
|
| +++ b/third_party/polymer/v1_0/components-chromium/app-route/app-route.html
|
| @@ -9,30 +9,30 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
| --><html><head><link rel="import" href="../polymer/polymer.html">
|
|
|
| <!--
|
| -`carbon-route` is an element that enables declarative, self-describing routing
|
| +`app-route` is an element that enables declarative, self-describing routing
|
| for a web app.
|
|
|
| -> *n.b. carbon-route is still in beta. We expect it will need some changes. We're counting on your feedback!*
|
| +> *n.b. app-route is still in beta. We expect it will need some changes. We're counting on your feedback!*
|
|
|
| -In its typical usage, a `carbon-route` element consumes an object that describes
|
| +In its typical usage, a `app-route` element consumes an object that describes
|
| some state about the current route, via the `route` property. It then parses
|
| that state using the `pattern` property, and produces two artifacts: some `data`
|
| related to the `route`, and a `tail` that contains the rest of the `route` that
|
| did not match.
|
|
|
| -Here is a basic example, when used with `carbon-location`:
|
| +Here is a basic example, when used with `app-location`:
|
|
|
| - <carbon-location route="{{route}}"></carbon-location>
|
| - <carbon-route
|
| + <app-location route="{{route}}"></app-location>
|
| + <app-route
|
| route="{{route}}"
|
| pattern="/:page"
|
| data="{{data}}"
|
| tail="{{tail}}">
|
| - </carbon-route>
|
| + </app-route>
|
|
|
| -In the above example, the `carbon-location` produces a `route` value. Then, the
|
| +In the above example, the `app-location` produces a `route` value. Then, the
|
| `route.path` property is matched by comparing it to the `pattern` property. If
|
| -the `pattern` property matches `route.path`, the `carbon-route` will set or update
|
| +the `pattern` property matches `route.path`, the `app-route` will set or update
|
| its `data` property with an object whose properties correspond to the parameters
|
| in `pattern`. So, in the above example, if `route.path` was `'/about'`, the value
|
| of `data` would be `{"page": "about"}`.
|
| @@ -42,24 +42,24 @@ The `tail` property represents the remaining part of the route state after the
|
|
|
| Here is another example, where `tail` is used:
|
|
|
| - <carbon-location route="{{route}}"></carbon-location>
|
| - <carbon-route
|
| + <app-location route="{{route}}"></app-location>
|
| + <app-route
|
| route="{{route}}"
|
| pattern="/:page"
|
| data="{{routeData}}"
|
| tail="{{subroute}}">
|
| - </carbon-route>
|
| - <carbon-route
|
| + </app-route>
|
| + <app-route
|
| route="{{subroute}}"
|
| pattern="/:id"
|
| data="{{subrouteData}}">
|
| - </carbon-route>
|
| + </app-route>
|
|
|
| -In the above example, there are two `carbon-route` elements. The first
|
| -`carbon-route` consumes a `route`. When the `route` is matched, the first
|
| -`carbon-route` also produces `routeData` from its `data`, and `subroute` from
|
| -its `tail`. The second `carbon-route` consumes the `subroute`, and when it
|
| -matches, it produces an object called `subrouteData` from its `tail`.
|
| +In the above example, there are two `app-route` elements. The first
|
| +`app-route` consumes a `route`. When the `route` is matched, the first
|
| +`app-route` also produces `routeData` from its `data`, and `subroute` from
|
| +its `tail`. The second `app-route` consumes the `subroute`, and when it
|
| +matches, it produces an object called `subrouteData` from its `data`.
|
|
|
| So, when `route.path` is `'/about'`, the `routeData` object will look like
|
| this: `{ page: 'about' }`
|
| @@ -70,13 +70,13 @@ And `subrouteData` will be null. However, if `route.path` changes to
|
|
|
| And the `subrouteData` will look like this: `{ id: '123' }`
|
|
|
| -`carbon-route` is responsive to bi-directional changes to the `data` objects
|
| +`app-route` is responsive to bi-directional changes to the `data` objects
|
| they produce. So, if `routeData.page` changed from `'article'` to `'about'`,
|
| -the `carbon-route` will update `route.path`. This in-turn will update the
|
| -`carbon-location`, and cause the global location bar to change its value.
|
| +the `app-route` will update `route.path`. This in-turn will update the
|
| +`app-location`, and cause the global location bar to change its value.
|
|
|
| -@element carbon-route
|
| +@element app-route
|
| @demo demo/index.html
|
| -->
|
|
|
| -</head><body><script src="carbon-route-extracted.js"></script></body></html>
|
| +</head><body><script src="app-route-extracted.js"></script></body></html>
|
|
|