|
313 | 313 | "body": [ |
314 | 314 | "import { Injectable } from '@angular/core';", |
315 | 315 | "", |
316 | | - "@Injectable()", |
| 316 | + "@Injectable({", |
| 317 | + "\tprovidedIn: 'root'", |
| 318 | + "})", |
317 | 319 | "export class ${Name}Service {", |
318 | 320 | "$0}" |
319 | 321 | ] |
|
982 | 984 | "import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';", |
983 | 985 | "import { Observable } from 'rxjs';", |
984 | 986 | "", |
985 | | - "@Injectable()", |
| 987 | + "@Injectable({", |
| 988 | + "\tprovidedIn: 'root'", |
| 989 | + "})", |
986 | 990 | "export class ${CanActivate}Guard implements CanActivate {", |
987 | 991 | "\tcanActivate(", |
988 | 992 | "\t\troute: ActivatedRouteSnapshot,", |
|
1003 | 1007 | "import { CanActivateChild, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';", |
1004 | 1008 | "import { Observable } from 'rxjs';", |
1005 | 1009 | "", |
1006 | | - "@Injectable()", |
| 1010 | + "@Injectable({", |
| 1011 | + "\tprovidedIn: 'root'", |
| 1012 | + "})", |
1007 | 1013 | "export class ${CanActivateChild}Guard implements CanActivateChild {", |
1008 | 1014 | "\tcanActivateChild(", |
1009 | 1015 | "\t\troute: ActivatedRouteSnapshot,", |
|
1024 | 1030 | "import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';", |
1025 | 1031 | "import { Observable } from 'rxjs';", |
1026 | 1032 | "", |
1027 | | - "@Injectable()", |
| 1033 | + "@Injectable({", |
| 1034 | + "\tprovidedIn: 'root'", |
| 1035 | + "})", |
1028 | 1036 | "export class ${Resolve}Guard implements Resolve<${T}> {", |
1029 | 1037 | "\tresolve(", |
1030 | 1038 | "\t\troute: ActivatedRouteSnapshot,", |
|
1045 | 1053 | "import { CanLoad, Route } from '@angular/router';", |
1046 | 1054 | "import { Observable } from 'rxjs';", |
1047 | 1055 | "", |
1048 | | - "@Injectable()", |
| 1056 | + "@Injectable({", |
| 1057 | + "\tprovidedIn: 'root'", |
| 1058 | + "})", |
1049 | 1059 | "export class ${CanLoad}Guard implements CanLoad {", |
1050 | 1060 | "\tcanLoad(", |
1051 | 1061 | "\t\t${route}: Route", |
|
1065 | 1075 | "import { CanDeactivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';", |
1066 | 1076 | "import { Observable } from 'rxjs';", |
1067 | 1077 | "", |
1068 | | - "@Injectable()", |
| 1078 | + "@Injectable({", |
| 1079 | + "\tprovidedIn: 'root'", |
| 1080 | + "})", |
1069 | 1081 | "export class ${CanDeactivate}Guard implements CanDeactivate<${T}> {", |
1070 | 1082 | "\tcanDeactivate(", |
1071 | 1083 | "\t\tcomponent: ${T},", |
|
1320 | 1332 | "import { Action } from '@ngrx/store';", |
1321 | 1333 | "import { Actions, Effect, ofType } from '@ngrx/effects';", |
1322 | 1334 | "", |
1323 | | - "@Injectable()", |
| 1335 | + "@Injectable({", |
| 1336 | + "\tprovidedIn: 'root'", |
| 1337 | + "})", |
1324 | 1338 | "export class ${Name}Effects {", |
1325 | 1339 | "\t@Effect() ${name}$: Observable<Action> = this.actions$.pipe(ofType('${ACTIONTYPE}'))$1;", |
1326 | 1340 | "", |
|
3097 | 3111 | "\tHttpEvent, HttpInterceptor, HttpHandler, HttpRequest", |
3098 | 3112 | "} from '@angular/common/http';", |
3099 | 3113 | "", |
3100 | | - "@Injectable()", |
| 3114 | + "@Injectable({", |
| 3115 | + "\tprovidedIn: 'root'", |
| 3116 | + "})", |
3101 | 3117 | "export class ${1:Name}Interceptor implements HttpInterceptor {", |
3102 | 3118 | "\tintercept(req: HttpRequest<any>, next: HttpHandler) {", |
3103 | 3119 | "\t\treturn next.handle(req);", |
|
0 commit comments