Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 9665df7

Browse files
cyrilletuzihansl
authored andcommitted
fix(@schematics/angular): providedIn in guard
1 parent 85c9f56 commit 9665df7

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

+3-1
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)