Implemented in a router:
export const MainRoutes: Route[] = [{
path: '',
children: [ {
path: 'main',
component: MainComponent ,
canActivate : [CanActivateRoute]
}]
}];
The canActivateRoute file:
@Injectable()
export class CanActivateRoute implements CanActi...