Updated the project.
This commit is contained in:
parent
5dfe9f128d
commit
7919556077
1550 changed files with 17063 additions and 40183 deletions
|
@ -1,6 +1,5 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { <%= routerImports %> } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@ -8,24 +7,24 @@ import { Observable } from 'rxjs';
|
|||
export class <%= classify(name) %>Guard implements <%= implementations %> {
|
||||
<% if (implements.includes('CanActivate')) { %>canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
state: RouterStateSnapshot): MaybeAsync<GuardResult> {
|
||||
return true;
|
||||
}
|
||||
<% } %><% if (implements.includes('CanActivateChild')) { %>canActivateChild(
|
||||
childRoute: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
state: RouterStateSnapshot): MaybeAsync<GuardResult> {
|
||||
return true;
|
||||
}
|
||||
<% } %><% if (implements.includes('CanDeactivate')) { %>canDeactivate(
|
||||
component: unknown,
|
||||
currentRoute: ActivatedRouteSnapshot,
|
||||
currentState: RouterStateSnapshot,
|
||||
nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
nextState?: RouterStateSnapshot): MaybeAsync<GuardResult> {
|
||||
return true;
|
||||
}
|
||||
<% } %><% if (implements.includes('CanMatch')) { %>canMatch(
|
||||
route: Route,
|
||||
segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
segments: UrlSegment[]): MaybeAsync<GuardResult> {
|
||||
return true;
|
||||
}<% } %>
|
||||
}
|
||||
|
|
2
my-app/node_modules/@schematics/angular/guard/index.js
generated
vendored
2
my-app/node_modules/@schematics/angular/guard/index.js
generated
vendored
|
@ -26,7 +26,7 @@ function default_1(options) {
|
|||
.map((implement) => (implement === 'CanDeactivate' ? 'CanDeactivate<unknown>' : implement))
|
||||
.join(', ');
|
||||
const commonRouterNameImports = ['ActivatedRouteSnapshot', 'RouterStateSnapshot'];
|
||||
const routerNamedImports = [...options.implements, 'UrlTree'];
|
||||
const routerNamedImports = [...options.implements, 'MaybeAsync', 'GuardResult'];
|
||||
if (options.implements.includes(schema_1.Implement.CanMatch)) {
|
||||
routerNamedImports.push('Route', 'UrlSegment');
|
||||
if (options.implements.length > 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue