As per title, what is the difference (if any) in a backbone view between saying:
this.$('.foo');
and
this.$el.find('.foo');
They both return the element and appear to scope it to the current view but I've seen examples using both methods.
Thanks
The difference is precisely none whatsoever. The method in Backbone source code is declared as:
$: function(selector) {
return this.$el.find(selector);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With