import { Injectable } from '@angular/core' ; import { ActivatedRouteSnapshot , CanActivate , Router , RouterStateSnapshot } from '@angular/router' ; import { AuthenticationService } from '@core/services/index.service' ; /**
 * Authentication Guard
 */ @ Injectable ( { providedIn : 'root' , } ) export class AuthGuard implements CanActivate { param router param authService constructor ( private router , private authService ) { } param next param state public canActivate ( next , state ) { if ( this . authService . isAuthenticated ) { return true ; } this . router . navigate ( [ '/' ] ) ; return false ; } }