knockout.js - knockout observable array push adding only first object -
i have observable array. assume (object) data has id, name, description
self.selectedobjects = ko.observablearray(); self.selectedobjects.push(data); self.selectedobjects.push(data);
line number 1 , 2 work fine. @ line number 3 debug point vanishes , never comes back.
this simple example works well, may problem somewhere else
var viewmodel = new function() { var self = this; var data = {"id" : "id1", "name" : "name1"}; self.selectedobjects = ko.observablearray(); self.selectedobjects.push(data); self.selectedobjects.push(data); } ko.applybindings(viewmodel);
Comments
Post a Comment