mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08: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:
committed by
Alex Rickabaugh
parent
16364514e3
commit
4f6014a756
@@ -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;
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user