fix(ivy): account for useValue: undefined providers in module injector (#27035)

PR Close #27035
This commit is contained in:
JoostK
2018-11-21 19:45:49 +01:00
committed by Alex Rickabaugh
parent 75723d5c89
commit 6552471c49
2 changed files with 17 additions and 2 deletions

View File

@ -248,7 +248,7 @@ export class R3Injector {
// Track the InjectorType and add a provider for it.
this.injectorDefTypes.add(defType);
this.records.set(defType, makeRecord(def.factory));
this.records.set(defType, makeRecord(def.factory, NOT_YET));
// Add providers in the same way that @NgModule resolution did:
@ -391,7 +391,7 @@ export function providerToFactory(provider: SingleProvider): () => any {
}
function makeRecord<T>(
factory: (() => T) | undefined, value: T | {} = NOT_YET, multi: boolean = false): Record<T> {
factory: (() => T) | undefined, value: T | {}, multi: boolean = false): Record<T> {
return {
factory: factory,
value: value,