From 96d06f7f0919ec65fbb9ca68a4a1e4ac85178820 Mon Sep 17 00:00:00 2001 From: David Purpura Date: Sun, 12 Feb 2017 09:13:23 -0800 Subject: [PATCH] fix(upgrade): Prevent property renaming for $inject. Switch to bracket notation for `directiveFactory.$inject`, otherwise Closure Compiler will (property) rename it, since the output type is `any`. --- modules/@angular/upgrade/src/common/downgrade_component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/@angular/upgrade/src/common/downgrade_component.ts b/modules/@angular/upgrade/src/common/downgrade_component.ts index 388b3bcefb..41899f7542 100644 --- a/modules/@angular/upgrade/src/common/downgrade_component.ts +++ b/modules/@angular/upgrade/src/common/downgrade_component.ts @@ -124,7 +124,8 @@ export function downgradeComponent(info: /* ComponentInfo */ { }; }; - directiveFactory.$inject = [$COMPILE, $INJECTOR, $PARSE]; + // bracket-notation because of closure - see #14441 + directiveFactory['$inject'] = [$COMPILE, $INJECTOR, $PARSE]; return directiveFactory; }