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中,使用該引用來填充視圖。有一個更好的方法嗎?謝謝。