From d648d709f3edcac56132e9e2a84a0fc65f5b48ac Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 12 Jan 2012 11:06:10 -0800 Subject: refactor(module): strict separation between module-config / app-runtime --- src/service/compiler.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/service/compiler.js') 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. *
-          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.
        *   
-       *     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('

{{total}}

')($rootScope); * }); *
@@ -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)); } }); -- cgit v1.2.3