1
所以我不知道什么是最好的方式做到这一点的,目前我有一个Ajax调用,看起来有些像这样传递到_this Ajax调用
var _this = this;
_.each(this.models, function (model) {
model.fetch({
success: function(model, response) {
if (_.has(model.attributes, "settings")) {
_this.populateSettings(_this);
}
}
在populateSettings方法,我需要一定的这个Backbone视图上的属性。我不确定如何获得这些属性,除了传入每个特定的属性,或传入对此骨干视图的引用以及在populateSettings中,使用该引用来填充视图。有一个更好的方法吗?谢谢。