Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AuthGuard

Hierarchy

  • AuthGuard

Implements

  • CanActivate

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private auth

Private router

router: Router

Methods

canActivate

  • canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean>
  • Used for guarding routes that require authentication

    Example:

    const routes: Routes = [
    ///...
    { path: 'notes', component: NotesListComponent,  canActivate: [AuthGuard] },
    ];

    Parameters

    • next: ActivatedRouteSnapshot

      route

    • state: RouterStateSnapshot

      current route

    Returns Observable<boolean>

    user login status

Generated using TypeDoc