App routing expressed as Polymer Custom Elements.
npm install @polymer/app-route


app-route is an element that enables declarative, self-describing routingSee: Documentation,
Large Demo,
Simple Demo,
Data Loading Demo.
npm install --save @polymer/app-route
`$3
`html
route="{{route}}"
pattern="/:page"
data="{{routeData}}"
tail="{{subroute}}">
route="{{subroute}}"
pattern="/:id"
data="{{subrouteData}}">
`$3
`js
import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/app-route/app-location.js';
import '@polymer/app-route/app-route.js';class SampleElement extends PolymerElement {
static get template() {
return html
;
}
}
customElements.define('sample-element', SampleElement);
`Contributing
If you want to send a PR to this element, here are the instructions for running
the tests and demo locally:$3
`sh
git clone https://github.com/PolymerElements/app-route
cd app-route
npm install
npm install -g polymer-cli
`$3
`sh
polymer serve --npm
open http://127.0.0.1:/demo/index.html
open http://127.0.0.1:/demo/simple-demo.html
open http://127.0.0.1:/demo/data-loading-demo.html
`$3
`sh
polymer test --npm
``