diff options
| author | Misko Hevery | 2010-01-22 11:21:22 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-01-22 11:21:22 -0800 |
| commit | e41ee88ef85986dcd0fea23fefcc57d89cee5c0b (patch) | |
| tree | 6c35423af336c3b2b6064c302cb174ded491c20b /src | |
| parent | a12b81773fd7ec2ca5c6453a1a7957c18c3c4671 (diff) | |
| download | angular.js-e41ee88ef85986dcd0fea23fefcc57d89cee5c0b.tar.bz2 | |
fix bug when multiple binders on same page
Diffstat (limited to 'src')
| -rw-r--r-- | src/Binder.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Binder.js b/src/Binder.js index b29a07c6..b687fb77 100644 --- a/src/Binder.js +++ b/src/Binder.js @@ -137,7 +137,6 @@ Binder.prototype = { compile: function() { var jNode = jQuery(this.doc); - var self = this; if (this.config.autoSubmit) { var submits = this.docFindWithSelf(":submit").not("[ng-action]"); submits.attr("ng-action", "$save()"); @@ -146,15 +145,16 @@ Binder.prototype = { this.precompile(this.doc)(this.doc, jNode.scope(), ""); this.docFindWithSelf("a[ng-action]").live('click', function (event) { var jNode = jQuery(this); + var scope = jNode.scope(); try { - jNode.scope().eval(jNode.attr('ng-action')); + scope.eval(jNode.attr('ng-action')); jNode.removeAttr('ng-error'); jNode.removeClass("ng-exception"); } catch (e) { jNode.addClass("ng-exception"); jNode.attr('ng-error', toJson(e, true)); } - self.updateView(); + scope.eval('$binder.updateView()'); return false; }); }, |
