Skip to content

Commit a271fe0

Browse files
cyrilletuzihansl
authored andcommitted
fix(@schematics/angular): providedIn in guard
1 parent a6de13c commit a271fe0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/schematics/angular/guard/files/__name@dasherize__.guard.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
22
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
33
import { Observable } from 'rxjs';
44

5-
@Injectable()
5+
@Injectable({
6+
providedIn: 'root'
7+
})
68
export class <%= classify(name) %>Guard implements CanActivate {
79
canActivate(
810
next: ActivatedRouteSnapshot,

0 commit comments

Comments
 (0)