diff options
Diffstat (limited to 'src/ng')
| -rw-r--r-- | src/ng/rootScope.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index b6a582bc..866b957e 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -300,6 +300,14 @@ function $RootScopeProvider(){ watcher.fn = function(newVal, oldVal, scope) {listenFn(scope);}; } + if (typeof watchExp == 'string' && get.constant) { + var originalFn = watcher.fn; + watcher.fn = function(newVal, oldVal, scope) { + originalFn.call(this, newVal, oldVal, scope); + arrayRemove(array, watcher); + }; + } + if (!array) { array = scope.$$watchers = []; } |
