私は自分のViewModelの1つを次のように持っています:
Models.DayP = function (data) {
var self = this;
this.Mapping = {
'Actions': {
create: function (options) {
return new App.Models.Action(self, options.data);
}
}
};
}
そして私はViewModelの1つを次のように持っています:
MPViewModel = function () {
this.Model = {};
this.Model.Test = ko.observable();
//ajax request made below to set the data. Testis type of Models.DayP
}
そして私は次のようにバインディングを設定しています:
<div data-bind="visible: Model.Test().Actions.length <= 0" style="display:none;">
</div>
問題は、このdivがAjaxリクエストの後に設定されていても常に表示されることですModel.Test().Actions
が、私のdivが非表示になることはありません。