aboutsummaryrefslogtreecommitdiffstats
path: root/src/Scope.js
diff options
context:
space:
mode:
authorMisko Hevery2010-03-22 16:07:42 -0700
committerMisko Hevery2010-03-22 16:07:42 -0700
commit6f8276a8e3735396999bd158005ca86bb1bb0978 (patch)
tree23bc9ff28e335ef75bac8e7473861e41191625c7 /src/Scope.js
parentd4ba33d075fea5e86963a9ff4982e433fc8c7968 (diff)
downloadangular.js-6f8276a8e3735396999bd158005ca86bb1bb0978.tar.bz2
ng-watch directive
Diffstat (limited to 'src/Scope.js')
-rw-r--r--src/Scope.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Scope.js b/src/Scope.js
index d22604fd..7b1d2673 100644
--- a/src/Scope.js
+++ b/src/Scope.js
@@ -207,6 +207,10 @@ Scope.prototype = {
},
addWatchListener: function(watchExpression, listener) {
+ // TODO: clean me up!
+ if (!isFunction(listener)) {
+ listener = bind(this, this.compile(listener), {scope: this, self: this.state});
+ }
var watcher = this.watchListeners[watchExpression];
if (!watcher) {
watcher = {listeners:[], expression:watchExpression};