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.
This commit is contained in:
lozanol 2017-05-12 10:03:38 -07:00 committed by Jason Aden
parent b016984c04
commit b83fe6f2a4
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}