fix(ivy): optional dependencies should not throw with module injector (#26763)
PR Close #26763
This commit is contained in:

committed by
Matias Niemelä

parent
1130e48541
commit
96770e5c6b
@ -368,6 +368,11 @@ export function getOrCreateInjectable<T>(
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & InjectFlags.Optional && notFoundValue === undefined) {
|
||||
// This must be set or the NullInjector will throw for optional deps
|
||||
notFoundValue = null;
|
||||
}
|
||||
|
||||
if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {
|
||||
const moduleInjector = lViewData[INJECTOR];
|
||||
if (moduleInjector) {
|
||||
|
Reference in New Issue
Block a user