0
0
JRJose Romero
This code defines a class named NameGuard which implements the CanLoad interface. The class has a constructor which, when called, sets the property providedIn to root . The canLoad() method returns true so that the NameGuard class can be used to guard the loading of routes.
Library: angular
Shortcut: angular.guard.canload
import { Injectable } from '@angular/core';
import { CanLoad, Route } from '@angular/router';
@Injectable({providedIn: 'root'})
export class NameGuard implements CanLoad {
constructor() { }
canLoad(route: Route) {
return true;
}
}