Skip to content

Commit 21e0cbc

Browse files
committed
simplified the bindAll example
1 parent f267025 commit 21e0cbc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,7 @@ <h2>Function (uh, ahem) Functions</h2>
646646
onClick : function(){ alert('clicked: ' + this.label); },
647647
onHover : function(){ console.log('hovering: ' + this.label); }
648648
};
649-
650-
// In this case, the following two lines have the same effect.
651-
_.bindAll(buttonView, 'onClick', 'onHover');
652-
_(buttonView).bindAll();
653-
649+
_.bindAll(buttonView);
654650
jQuery('#underscore_button').bind('click', buttonView.onClick);
655651
=&gt; When the button is clicked, this.label will have the correct value...
656652
</pre>

0 commit comments

Comments
 (0)