aboutsummaryrefslogtreecommitdiffstats
path: root/src/Compiler.js
diff options
context:
space:
mode:
authorMisko Hevery2011-04-18 16:33:30 -0700
committerMisko Hevery2011-06-08 15:21:31 -0700
commit8cad231bd219eddd518de8b8bd040d3f12f08d17 (patch)
tree75016fa6de683a877916f45a0fd06b1d0f312231 /src/Compiler.js
parent0e17ade959cc77369dc102d180e43be2af68505a (diff)
downloadangular.js-8cad231bd219eddd518de8b8bd040d3f12f08d17.tar.bz2
Refactor injector to have invoke method for speed reasons
Diffstat (limited to 'src/Compiler.js')
-rw-r--r--src/Compiler.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Compiler.js b/src/Compiler.js
index d5eeae79..08c76eea 100644
--- a/src/Compiler.js
+++ b/src/Compiler.js
@@ -34,7 +34,7 @@ Template.prototype = {
forEach(this.inits, function(fn) {
queue.push(function() {
childScope.$tryEval(function(){
- return childScope.$service(fn, childScope, element);
+ return childScope.$service.invoke(childScope, fn, [element]);
}, element);
});
});
@@ -49,9 +49,11 @@ Template.prototype = {
},
- addInit:function(init) {
- if (init) {
- this.inits.push(init);
+ addInit:function(linkingFn) {
+ if (linkingFn) {
+ if (!linkingFn.$inject)
+ linkingFn.$inject = [];
+ this.inits.push(linkingFn);
}
},