refactor(compiler-cli): having an `ɵinj` field no longer guarantees injectability (#41231)
When `ɵngDeclareInjector()` was implemented, the `factory` was moved out to the `ɵfac` static property on the class. This check was not updated. PR Close #41231
This commit is contained in:
parent
857dfaa1e7
commit
94a9985b8b
|
@ -223,6 +223,5 @@ function afterUnderscore(str: string): string {
|
||||||
/** Returns whether a class declaration has the necessary class fields to make it injectable. */
|
/** Returns whether a class declaration has the necessary class fields to make it injectable. */
|
||||||
export function hasInjectableFields(clazz: ClassDeclaration, host: ReflectionHost): boolean {
|
export function hasInjectableFields(clazz: ClassDeclaration, host: ReflectionHost): boolean {
|
||||||
const members = host.getMembersOfClass(clazz);
|
const members = host.getMembersOfClass(clazz);
|
||||||
return members.some(
|
return members.some(({isStatic, name}) => isStatic && (name === 'ɵprov' || name === 'ɵfac'));
|
||||||
({isStatic, name}) => isStatic && (name === 'ɵprov' || name === 'ɵfac' || name === 'ɵinj'));
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue