I am new to angular & googled for hours to find solutions on lazy route.
https://stackblitz.com/edit/angular-7jmk87
app-routing.module.ts
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent},
{ path: 'customers', loadChildren: './pages/customers/customers.module#CustomersModule' }
];
customer-routing.module.ts
const routes: Routes = [
{
path: '',
component: CustomersComponent,
},
{ path: 'detail', component: CustomerDetailComponent },
];
what I want is to redirect to /customers/detail from /customers, but it return an error like Cannot match any routes. URL Segment: 'detail'.
I follow some examples but it still not solved yet.
I hope someone can give a hand to me. Thanks.
<a routerLink='/customers/detail'>Detail</a>