diff options
Diffstat (limited to 'src/service')
| -rw-r--r-- | src/service/compiler.js | 12 | ||||
| -rw-r--r-- | src/service/scope.js | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/service/compiler.js b/src/service/compiler.js index 8a0dca7d..727f7983 100644 --- a/src/service/compiler.js +++ b/src/service/compiler.js @@ -28,7 +28,7 @@ function $CompileProvider(){ forEach(this.linkFns, function(fn) { try { if (isArray(fn) || fn.$inject) { - $injector.invoke(childScope, fn, locals); + $injector.invoke(fn, childScope, locals); } else { fn.call(childScope, element); } @@ -97,7 +97,7 @@ function $CompileProvider(){ * that is a DOM clone of the original template. * <pre> - angular.injector('ng').invoke(null, function($rootScope, $compile) { + angular.injector(['ng']).invoke(function($rootScope, $compile) { // Chose one: // A: compile the entire window.document. @@ -143,8 +143,8 @@ function $CompileProvider(){ * - If you are not asking the linking function to clone the template, create the DOM element(s) * before you send them to the compiler and keep this reference around. * <pre> - * var $injector = angular.injector('ng'); - * var scope = $injector.invoke(null, function($rootScope, $compile){ + * var $injector = angular.injector(['ng']); + * var scope = $injector.invoke(function($rootScope, $compile){ * var element = $compile('<p>{{total}}</p>')($rootScope); * }); * </pre> @@ -277,7 +277,7 @@ function $CompileProvider(){ descend = false; directives = false; var parent = element.parent(); - template.addLinkFn($injector.invoke(selfApi, widget, locals)); + template.addLinkFn($injector.invoke(widget, selfApi, locals)); if (parent && parent[0]) { element = jqLite(parent[0].childNodes[elementIndex]); } @@ -310,7 +310,7 @@ function $CompileProvider(){ if (fn) { element.addClass('ng-directive'); template.addLinkFn((isArray(fn) || fn.$inject) - ? $injector.invoke(selfApi, fn, {$value:value, $element: element}) + ? $injector.invoke(fn, selfApi, {$value:value, $element: element}) : fn.call(selfApi, value, element)); } }); diff --git a/src/service/scope.js b/src/service/scope.js index 2836b42e..a19bf83e 100644 --- a/src/service/scope.js +++ b/src/service/scope.js @@ -50,7 +50,7 @@ function $RootScopeProvider(){ * * Here is a simple scope snippet to show how you can interact with the scope. * <pre> - angular.injector(function($rootScope) { + angular.injector(['ng']).invoke(function($rootScope) { var scope = $rootScope.$new(); scope.salutation = 'Hello'; scope.name = 'World'; @@ -168,7 +168,7 @@ function $RootScopeProvider(){ for(var key in ClassPrototype) { child[key] = bind(child, ClassPrototype[key]); } - $injector.invoke(child, Class, curryArguments); + $injector.invoke(Class, child, curryArguments); } return child; }, |
