Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplified the bindAll example

  • Loading branch information...
commit 21e0cbc229f3da0f2b10716be06752465fee7dfc 1 parent f267025
@jashkenas jashkenas authored
Showing with 1 addition and 5 deletions.
  1. +1 −5 index.html
View
6 index.html
@@ -646,11 +646,7 @@ <h2 id="styles">Object-Oriented and Functional Styles</h2>
onClick : function(){ alert('clicked: ' + this.label); },
onHover : function(){ console.log('hovering: ' + this.label); }
};
-
-// In this case, the following two lines have the same effect.
-_.bindAll(buttonView, 'onClick', 'onHover');
-_(buttonView).bindAll();
-
+_.bindAll(buttonView);
jQuery('#underscore_button').bind('click', buttonView.onClick);
=&gt; When the button is clicked, this.label will have the correct value...
</pre>
Please sign in to comment.
Something went wrong with that request. Please try again.