aboutsummaryrefslogtreecommitdiffstats
path: root/src/Compiler.js
diff options
context:
space:
mode:
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);
}
},