aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js1
-rw-r--r--src/Binder.js2
-rw-r--r--src/Scope.js5
3 files changed, 7 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js
index ded4485f..fa6a610c 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -294,6 +294,7 @@ function wireAngular(element, config) {
'$anchor' : binder.anchor,
'$updateView': _(binder.updateView).bind(binder),
'$config' : config,
+ '$invalidWidgets': [],
'$console' : window.console,
'$datastore' : exposeMethods(datastore, {
'load': datastore.load,
diff --git a/src/Binder.js b/src/Binder.js
index e516ec32..8dac934b 100644
--- a/src/Binder.js
+++ b/src/Binder.js
@@ -95,7 +95,7 @@ Binder.prototype = {
updateView: function() {
var start = new Date().getTime();
var scope = jQuery(this.doc).scope();
- scope.set("$invalidWidgets", []);
+ scope.clearInvalid();
scope.updateView();
var end = new Date().getTime();
this.updateAnchor();
diff --git a/src/Scope.js b/src/Scope.js
index b8fadfa0..cedb0542 100644
--- a/src/Scope.js
+++ b/src/Scope.js
@@ -153,6 +153,11 @@ Scope.prototype = {
return expression({scope:this, datastore:datastore});
},
+ clearInvalid: function() {
+ var invalid = this.state['$invalidWidgets'];
+ while(invalid.length > 0) {invalid.pop();}
+ },
+
markInvalid: function(widget) {
this.state['$invalidWidgets'].push(widget);
},