source: trip-planner-front/node_modules/@schematics/angular/guard/files/__name@dasherize__.guard.ts.template@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1import { Injectable } from '@angular/core';
2import { <%= implementationImports %> } from '@angular/router';
3import { Observable } from 'rxjs';
4
5@Injectable({
6 providedIn: 'root'
7})
8export 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.