Open web-dave opened 7 years ago
<li><a [routerLink]="['books']">Books</a></li>
<li><a [routerLink]="['about']">About</a></li>
const routes: Routes = [
{
path: 'books',
component: BooksComponent
},
{
path: 'about',
component: AboutComponent
},
{
path: '',
redirectTo: '/books',
pathMatch: 'full' <-- !!
},
{
path: '**', <-- Fallback allways the last route!
redirectTo: '/about'
}
];
routerLink
inmy-nav
/books
as default/about
as fallback<books></books>
from app.component.html