| Index: third_party/polymer/v1_0/components-chromium/carbon-route/carbon-route-converter.html
|
| diff --git a/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-route-converter.html b/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-route-converter.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3924cfd540be3242da50184c420c70cee6abee76
|
| --- /dev/null
|
| +++ b/third_party/polymer/v1_0/components-chromium/carbon-route/carbon-route-converter.html
|
| @@ -0,0 +1,58 @@
|
| +<!--
|
| +@license
|
| +Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
| +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
| +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
| +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
| +Code distributed by Google as part of the polymer project is also
|
| +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
| +--><html><head><link rel="import" href="../polymer/polymer.html">
|
| +
|
| +<!--
|
| +`carbon-route-converter` provides a means to convert a path and query
|
| +parameters into a route object and vice versa. This produced route object
|
| +is to be fed into route-consuming elements such as `carbon-route`.
|
| +
|
| +> n.b. This element is intended to be a primitive of the routing system and for
|
| +creating bespoke routing solutions from scratch. To simply include routing in
|
| +an app, please refer to [carbon-location](https://github.com/PolymerElements/carbon-route/blob/master/carbon-location.html)
|
| +and [carbon-route](https://github.com/PolymerElements/carbon-route/blob/master/carbon-route.html).
|
| +
|
| +An example of a route element that describes
|
| +`https://elements.polymer-project.org/elements/carbon-route-converter?foo=bar&baz=qux`:
|
| +
|
| + {
|
| + prefix: '',
|
| + path: '/elements/carbon-route-converter',
|
| + queryParams: {
|
| + foo: 'bar',
|
| + baz: 'qux'
|
| + }
|
| + }
|
| +
|
| +Example Usage:
|
| +
|
| + <iron-location path="{{path}}" query="{{query}}"></iron-location>
|
| + <iron-query-params
|
| + params-string="{{query}}"
|
| + params-object="{{queryParams}}">
|
| + </iron-query-params>
|
| + <carbon-route-converter
|
| + path="{{path}}"
|
| + query-params="{{queryParams}}"
|
| + route="{{route}}">
|
| + </carbon-route-converter>
|
| + <carbon-route route='{{route}}' pattern='/:page' data='{{data}}'>
|
| + </carbon-route>
|
| +
|
| +This is a simplified implementation of the `carbon-location` element. Here the
|
| +`iron-location` produces a path and a query, the `iron-query-params` consumes
|
| +the query and produces a queryParams object, and the `carbon-route-converter`
|
| +consumes the path and the query params and converts it into a route which is in
|
| +turn is consumed by the `carbon-route`.
|
| +
|
| +@element carbon-route-converter
|
| +@demo demo/index.html
|
| +-->
|
| +
|
| +</head><body><script src="carbon-route-converter-extracted.js"></script></body></html>
|
|
|