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:
SkyZeroZx 2025-12-10 18:08:55 -05:00 committed by Alex Rickabaugh
parent 16364514e3
commit 4f6014a756
2 changed files with 2 additions and 2 deletions

View file

@ -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?: {

View file

@ -74,7 +74,7 @@ export class InjectionToken<T> {
constructor(
_desc: string,
options: {
providedIn?: Type<any> | 'any';
providedIn: Type<any> | 'any';
factory: () => T;
},
);