我有一个计算的可观察量:
passengerDocs.passengerDocsViewModel = function () {
var self = this;
self.isFunctionsDone = ko.observableArray([false, false, false, false, false, false, false]);
self.IsCompleted = ko.computed(function () {
var isFinished = true;
ko.utils.arrayForEach(self.isFunctionsDone(), function (x) {
if (x == false) isFinished = false;
});
return isFinished;
});
问题是即使 isFunctionDone 的所有元素都为真,它也总是返回假。有任何想法吗?