mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(core): avoid false-positive deprecation when using InjectionToken with factory only
Prevents the deprecation warning that was incorrectly triggered when defining an InjectionToken with only a `factory`, which correctly defaults to the `root` scope.
This commit is contained in:
parent
16364514e3
commit
4f6014a756
2 changed files with 2 additions and 2 deletions
|
|
@ -922,7 +922,7 @@ export interface InjectDecorator {
|
|||
export class InjectionToken<T> {
|
||||
// @deprecated
|
||||
constructor(_desc: string, options: {
|
||||
providedIn?: Type<any> | 'any';
|
||||
providedIn: Type<any> | 'any';
|
||||
factory: () => T;
|
||||
});
|
||||
constructor(_desc: string, options?: {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ export class InjectionToken<T> {
|
|||
constructor(
|
||||
_desc: string,
|
||||
options: {
|
||||
providedIn?: Type<any> | 'any';
|
||||
providedIn: Type<any> | 'any';
|
||||
factory: () => T;
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue