我有一个包含两个数组的 ViewModel:arr1
和arr2
. 我想arr2
准确地包含所arr1
包含的内容。我怎样才能做到这一点?
var myViewModel = function() {
this.arr1 = ko.observableArray([]);
this.arr2 = ko.observableArray(this.arr1); //Doesn't work - I need to bind arr2 to changes in arr1
}