Skip to content

Commit 7baa79e

Browse files
feat(angular1): Only require the controllerExpression in annotateController()
1 parent ee16d2c commit 7baa79e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/common/angular1.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export let runtime: IRuntime = {
2828
* - Annotate constructor
2929
* - Undecorate $injector
3030
*/
31-
export function annotateController($controller: Function, $injector: ng.auto.IInjectorService, controllerExpression) {
31+
32+
export function annotateController(controllerExpression) {
33+
let $injector = runtime.$injector;
34+
let $controller = $injector.get("$controller");
3235
let oldInstantiate = $injector.instantiate;
3336
try {
3437
let deps;

src/view/viewDirective.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function $ViewDirectiveFill ( $compile, $controller, $interpolate, $injec
290290
let viewLocals = data.$locals, annotatedFn = controller;
291291
if (isString(controller)) {
292292
annotatedFn = function() {};
293-
annotatedFn.$inject = annotateController($controller, $injector, controller);
293+
annotatedFn.$inject = annotateController(controller);
294294
}
295295

296296
viewLocals.getLocalsFor(annotatedFn).then(function(locals) {

0 commit comments

Comments
 (0)