From b83fe6f2a4ac586f1603e01edd8e36d2b0aac16a Mon Sep 17 00:00:00 2001 From: lozanol Date: Fri, 12 May 2017 10:03:38 -0700 Subject: [PATCH] fix(upgrade): Prevent renaming of $inject property (#16706) Use bracket notation to access $inject in downgradeInjectable to support property renaming. Since the return type is any, Closure compiler renames $inject. --- packages/upgrade/src/common/downgrade_injectable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/upgrade/src/common/downgrade_injectable.ts b/packages/upgrade/src/common/downgrade_injectable.ts index 7a1a50f054..e9894e36fb 100644 --- a/packages/upgrade/src/common/downgrade_injectable.ts +++ b/packages/upgrade/src/common/downgrade_injectable.ts @@ -53,7 +53,7 @@ import {INJECTOR_KEY} from './constants'; */ export function downgradeInjectable(token: any): Function { const factory = function(i: Injector) { return i.get(token); }; - (factory as any).$inject = [INJECTOR_KEY]; + (factory as any)['$inject'] = [INJECTOR_KEY]; return factory; }