Angular Unable to map routes: 'login'. Look at the tree as shown below:
App
/\
/ \
Private Public
/\
/ \
Home Login
Then the code looks like this:
export const routes: RouterConfig = [
{ path: '', redirectTo: 'public', pathMatch: 'full' },
{ path: 'private', component: PrivateComponent },
{ path: 'public', component: PublicComponent,
children: [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent},
{ path: 'login', component: LoginComponent}
]
}
];
Hope this help!
source
share