From d3cd3c0a9baa27a552cabe1938931743c13d307e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Bo=CC=88hm?= Date: Tue, 30 Apr 2013 00:02:58 +0200 Subject: [PATCH] style($injector): add a comment to explain the distinction with isArray --- src/auto/injector.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/auto/injector.js b/src/auto/injector.js index ce68ef14..185995b4 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -585,6 +585,8 @@ function createInjector(modulesToLoad) { var Constructor = function() {}, instance, returnedValue; + // Check if Type is annotated and use just the given function at n-1 as parameter + // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype; instance = new Constructor(); returnedValue = invoke(Type, instance, locals);