Open web-dave opened 4 years ago
const routes: Routes = [
{
path: '',
redirectTo: '/fleet',
pathMatch: 'full'
}
];
const routes: Routes = [
{
path: 'about',
component: AboutComponent
}
];
const routes: Routes = [
{
path: 'fleet',
component: FleetComponent
}
];
<a class="nav-link" routerLink="fleet">Flotte</a>
<!-- OR-->
<a class="nav-link" [routerLink]="['fleet']">Flotte</a>
You can use routerLinkActive
to add the active
class automatically
<a class="nav-link" routerLinkActive="active" routerLink="fleet">Flotte</a>
/fleet
as defaultNavigation
View<mgr-fleet></mgr-fleet>
fromapp.component.html