type-alias
deprecated
The InjectionToken
and @Injectable
classes for guards and resolvers are deprecated in favor of plain JavaScript functions instead.. Dependency injection can still be achieved using the inject
function from @angular/core
and an injectable class can be used as a functional guard using inject
: canActivate: [() => inject(myGuard).canActivate()]
.
Deprecated:
type DeprecatedGuard = ProviderToken<any> | any;
© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/router/DeprecatedGuard