Added support for Array Change subscriptions. Added tests to the test_observableArrays() in knockout-tests.ts.

This commit is contained in:
EWOUT-QMINO\Ewout
2014-10-07 12:20:56 +02:00
parent 9dbc0c5a46
commit 9967239f2a
2 changed files with 14 additions and 1 deletions
+9
View File
@@ -108,6 +108,15 @@ function testGetter() {
function test_observableArrays() {
var myObservableArray = ko.observableArray<any>();
myObservableArray.subscribe(function(changes){
for(var i = 0; i < changes.length; i++){
console.log(changes[i].index);
console.log(changes[i].status);
console.log(changes[i].value);
}
}, null, "arrayChange");
myObservableArray.push('Some value');
var anotherObservableArray = ko.observableArray([
{ name: "Bungle", type: "Bear" },