aurelia-crumbs
This is an aurelia breadcrumbs widget conceived as a custom element that renders your application router's active navigation instruction chain.
Getting Started
Download from npm:
npm install aurelia-crumbs
In your applications main file:
aureliause ...
In your route declarations (that you pass to your router), you can now include an option breadcrumb property:
const routes: route: 'route1' name: 'route1' moduleId: './routes/route1/route1' title: 'Route 1' breadcrumb: true route: 'route2' name: 'route2' moduleId: './routes/route2/route2' title: 'Route 2' breadcrumb: true ; ... { routerConfigoptionspushState = true; routerConfig; this; thisrouter = router; } ...
In order for a route to be rendered by the breadcrumb widget, the route's config have breadcrumb === true and a truthy title.
Then, add the custom element somewhere in your application:
Configuration
The widget takes an optional config object which has one parameter:
- Separator: valid html string.
Dynamic route titles
If you want to dynamically change a route title in the widget, you can do the following:
@ { thisrouter = router; } { thisroutercurrentInstructionconfigtitle = 'New Title'; }