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); 

jsfiddle demo


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -