fix: consistently rewrite Injector to INJECTOR (#23008)

In Ivy mode we rewrite references to Injector to INJECTOR in ngInjectableDef, to fix tree-shaking.

This changes the rewrite to happen always, even in non-Ivy mode, and makes Angular understand
INJECTOR across the board at runtime.

PR Close #23008
This commit is contained in:
Alex Rickabaugh
2018-03-26 16:22:46 -07:00
parent 0b348c8ffe
commit 884bf0ef09
5 changed files with 33 additions and 4 deletions

View File

@ -145,7 +145,7 @@ export class StaticInjector implements Injector {
records.set(
Injector, <Record>{token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false});
records.set(
INJECTOR, <Record>{token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false});
INJECTOR, <Record>{token: INJECTOR, fn: IDENT, deps: EMPTY, value: this, useNew: false});
recursivelyProcessProviders(records, providers);
}