1.2.9 • Published 8 years ago
angular-nav-title v1.2.9
Simple straightforward page navigation titles.
This module requires Angular 2 router.
Demo
https://alex-craiu.github.io/angular-demo/
Installation
$ npm install --save angular-nav-titleUsage
- Import the module
import { NavTitleModule } from 'angular-nav-title';
@NgModule({
...
imports: [NavTitleModule]
...
});- Add the
navTitleparam to your route'sdata:
...
const routes: Routes = [
{
path: '',
component: ArticlesComponent,
data: { navTitle: 'Articles' },
children: [
{ path: '', component: ArticleListComponent, data: { navTitle: 'List' } }
]
}
];
...- Insert the
NavTitleComponentselector intoapp.component.html:
<nav-title></nav-title>If navTitle isn't specified it won't render on screen. On title click, it navigates to the corresponding route.
Additional properties
Change the title separator (default: '–'):
<nav-title separator=">"></nav-title>Change the param name (default: 'navTitle'):
<nav-title dataParam="breadcrumb"></nav-title>