4 Commits

Author SHA1 Message Date
ced
2f92fe7e58 fix(@schematics/angular): add missing semicolon in functional guard/resolver/interceptor 2022-12-02 09:04:22 +00:00
ced
451975f765 fix(@schematics/angular): use proper variable in resolver functional spec 2022-11-28 13:54:17 +00:00
Andrew Scott
978274cb0b refactor(@schematics/angular): Use runInInjectionContext shorthand
The runInInjectionContext helper was added in 6acae1477a.
This is a shorthand for TestBed.inject(EnvironmentInjector).runInContext.
2022-11-28 13:16:52 +00:00
Andrew Scott
6c39a162be feat(@schematics/angular): Add schematics for generating functional router guards and resolvers
Functional guards and resolvers were introduced in the Angular router in v14.2.
This commit adds the ability to generate functional router guards by
specifying `--guardType` instead of `--implements`. These guards are also
accompanied by a test that includes a helper function for executing the
guard in the `TestBed` environment so that any `inject` calls in the
guard will work properly. Functional resolvers are generated by adding
the `--functional` flag.
2022-11-09 09:34:07 +01:00