Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | import { Injectable } from '@angular/core';
|
---|
2 | import { <%= implementationImports %> } from '@angular/router';
|
---|
3 | import { Observable } from 'rxjs';
|
---|
4 |
|
---|
5 | @Injectable({
|
---|
6 | providedIn: 'root'
|
---|
7 | })
|
---|
8 | export class <%= classify(name) %>Guard implements <%= implementations %> {
|
---|
9 | <% if (implements.includes('CanActivate')) { %>canActivate(
|
---|
10 | route: ActivatedRouteSnapshot,
|
---|
11 | state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
---|
12 | return true;
|
---|
13 | }
|
---|
14 | <% } %><% if (implements.includes('CanActivateChild')) { %>canActivateChild(
|
---|
15 | childRoute: ActivatedRouteSnapshot,
|
---|
16 | state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
---|
17 | return true;
|
---|
18 | }
|
---|
19 | <% } %><% if (implements.includes('CanDeactivate')) { %>canDeactivate(
|
---|
20 | component: unknown,
|
---|
21 | currentRoute: ActivatedRouteSnapshot,
|
---|
22 | currentState: RouterStateSnapshot,
|
---|
23 | nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
---|
24 | return true;
|
---|
25 | }
|
---|
26 | <% } %><% if (implements.includes('CanLoad')) { %>canLoad(
|
---|
27 | route: Route,
|
---|
28 | segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
---|
29 | return true;
|
---|
30 | }<% } %>
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.