Properties
Private router
router: Router
Methods
canActivate
- canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean>
-
Parameters
-
next: ActivatedRouteSnapshot
-
state: RouterStateSnapshot
Returns Observable<boolean>
user login status
Used for guarding routes that require authentication
Example:
const routes: Routes = [ ///... { path: 'notes', component: NotesListComponent, canActivate: [AuthGuard] }, ];