fix(core): Injector correctly honors the @Self flag (#24520)
Injector was incorrectly returning instance from parent injector even when `@Self` was specified. PR Close #24520
This commit is contained in:
@ -118,6 +118,8 @@ export function resolveNgModuleDep(
|
||||
return (
|
||||
data._providers[index] =
|
||||
_createProviderInstance(data, data._def.providersByKey[depDef.tokenKey]));
|
||||
} else if (depDef.flags & DepFlags.Self) {
|
||||
return notFoundValue;
|
||||
}
|
||||
return data._parent.get(depDef.token, notFoundValue);
|
||||
} finally {
|
||||
|
Reference in New Issue
Block a user