Skip to content

Commit d11f863

Browse files
committed
Merge pull request #32 from ctucker/boif-fix
Consume binders array as we process it.
2 parents 004000b + e091c27 commit d11f863

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

bindonce.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,13 @@
101101
}
102102
},
103103

104-
runBinders: function ()
104+
runBinders : function()
105105
{
106-
var i, max;
107-
for (i = 0, max = this.binders.length; i < max; i++)
108-
{
109-
var binder = this.binders[i];
110-
if (this.group && this.group !== binder.group) continue;
106+
while(this.binders.length > 0) {
107+
var binder = this.binders.shift();
108+
if (this.group && this.group != binder.group ) continue;
111109
var value = binder.scope.$eval((binder.interpolate) ? $interpolate(binder.value) : binder.value);
112-
switch (binder.attr)
110+
switch(binder.attr)
113111
{
114112
case 'if':
115113
if (toBoolean(value))
@@ -269,4 +267,4 @@
269267
return bindonceDirective;
270268
});
271269
});
272-
})();
270+
})();

0 commit comments

Comments
 (0)