import { ActivatedRouteSnapshot , CanActivate , RouterStateSnapshot } from '@angular/router' ; import { Injectable } from '@angular/core' ; import { AuthService } from '@core/services/auth.service' ; @ Injectable ( { providedIn : 'root' } ) export class AuthGuard implements CanActivate { constructor ( private _authservice ) { } canActivate ( route , state ) { return this . _authservice . isLoggedIn ( ) ; } }