import {Injectable} from '@angular/core';
import {Route, CanActivate} from '@angular/router';
@Injectable()
export class AuthGuard implements CanActivate {
constructor(private router: Route) {
}
canActivate() {
if (localStorage.getItem('currentUser')) {
return true;
}
this.router.navigate(["/login"]);
return false;
}
}
ERROR in [at-loader] resources/assets/src/app/_guards/auth.guard.ts:13:21
Property 'navigate' does not exist on type 'Route'.