What is the difference between canLoad
and canActivate
?
export interface Route {
path?: string;
pathMatch?: string;
matcher?:
canActivate is used to prevent an unauthorized user
canLoad is used to prevent the entire module of app
Example of canActivate:
{ path: 'product',canActivate:[RouteGaurd], component : ProductComponent }
Example of canLoad:
{ path: 'user' , canLoad: [AuthenticGuard], loadChildren : './user/user.module#UserModule' }