Could anybody tell me the difference between component
, loadChildren
, redirectTo
?
export const ROUTES: Routes = [{
path: '', redirectTo: 'signin', pathMatch: 'full'
}, {
path: 'app', loadChildren: () => System.import('./layout/layout.module')
}, {
path: 'login', loadChildren: () => System.import('./login/login.module')
}, {
path: 'signin', loadChildren: () => System.import('./signin/signin.module')
}, {
path: 'error', component: ErrorComponent
}, {
path: '**', component: ErrorComponent
}
];
Apparently, the documentation can do it. Check the router page.
Otherwise, component
is to directly link a path to a component
, loadChildren
is used to load asynchronous component
and redirectTo
is simply to redirect to another route.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With