Skip to content

Commit

Permalink
fix(upgrade): Prevent renaming of $inject property (angular#16706)
Browse files Browse the repository at this point in the history
Use bracket notation to access $inject in downgradeInjectable to
support property renaming. Since the return type is any,
Closure compiler renames $inject.
  • Loading branch information
lozanol authored and juleskremer committed Aug 24, 2017
1 parent a5081e7 commit 5b55619
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/upgrade/src/common/downgrade_injectable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 5b55619

Please sign in to comment.