passing _this into an ajax call

rarfskarp

New Member
So I'm not sure what the best way to do this is, currently I have an ajax call that looks some like this\[code\]var _this = this; _.each(this.models, function (model) { model.fetch({ success: function(model, response) { if (_.has(model.attributes, "settings")) { _this.populateSettings(_this); } }\[/code\]In the populateSettings method, I need certain attributes on this Backbone view. I wasn't sure how to get those attributes except to pass in each specific attribute, or pass in a reference to this backbone view and in populateSettings, use that reference to populate the view. Is there a better way to do this? Thanks.
 
Back
Top