mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added support for Array Change subscriptions. Added tests to the test_observableArrays() in knockout-tests.ts.
This commit is contained in:
@@ -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" },
|
||||
|
||||
Reference in New Issue
Block a user