mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
style($injector): add a comment to explain the distinction with isArray
This commit is contained in:
committed by
Pete Bacon Darwin
parent
ef7ba7b212
commit
d6984db4d5
@@ -584,6 +584,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);
|
||||
|
||||
Reference in New Issue
Block a user