mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 06:41:45 +08:00
Currently when using `ivy-ngcc` it will print out a warning ``` Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121. ``` Fixes #13378
25 lines
978 B
Plaintext
25 lines
978 B
Plaintext
import { Injectable } from '@angular/core';
|
|
import { <%= implementationImports %>ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';
|
|
import { Observable } from 'rxjs';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class <%= classify(name) %>Guard implements <%= implementations %> {
|
|
<% if (implements.includes('CanActivate')) { %>canActivate(
|
|
next: ActivatedRouteSnapshot,
|
|
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
|
return true;
|
|
}
|
|
<% } %><% if (implements.includes('CanActivateChild')) { %>canActivateChild(
|
|
next: ActivatedRouteSnapshot,
|
|
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
|
return true;
|
|
}
|
|
<% } %><% if (implements.includes('CanLoad')) { %>canLoad(
|
|
route: Route,
|
|
segments: UrlSegment[]): Observable<boolean> | Promise<boolean> | boolean {
|
|
return true;
|
|
}<% } %>
|
|
}
|