Simple straightforward page navigation titles.
This module requires Angular router.
https://alex-craiu.github.io/angular-demo/
$ npm install --save angular-nav-title
- Import the module
import { NavTitleModule } from 'angular-nav-title';
@NgModule({
...
imports: [NavTitleModule]
...
});
- Add the
navTitle
param to your route'sdata
:
...
const routes: Routes = [
{
path: '',
component: ArticlesComponent,
data: { navTitle: 'Articles' },
children: [
{ path: '', component: ArticleListComponent, data: { navTitle: 'List' } }
]
}
];
...
- Insert the
NavTitleComponent
selector 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.
Change the title separator (default: '–'):
<nav-title separator=">"></nav-title>
Change the param name (default: 'navTitle'):
<nav-title dataParam="breadcrumb"></nav-title>