Skip to content

Commit

Permalink
Merge pull request #32 from ctucker/boif-fix
Browse files Browse the repository at this point in the history
Consume binders array as we process it.
  • Loading branch information
Pasvaz committed Jan 20, 2014
2 parents 004000b + e091c27 commit d11f863
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions bindonce.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,13 @@
}
},

runBinders: function ()
runBinders : function()
{
var i, max;
for (i = 0, max = this.binders.length; i < max; i++)
{
var binder = this.binders[i];
if (this.group && this.group !== binder.group) continue;
while(this.binders.length > 0) {
var binder = this.binders.shift();
if (this.group && this.group != binder.group ) continue;
var value = binder.scope.$eval((binder.interpolate) ? $interpolate(binder.value) : binder.value);
switch (binder.attr)
switch(binder.attr)
{
case 'if':
if (toBoolean(value))
Expand Down Expand Up @@ -269,4 +267,4 @@
return bindonceDirective;
});
});
})();
})();

0 comments on commit d11f863

Please sign in to comment.