knockout.js - Knockout component with observable object doesn't update data -
i have following component: <template id="fruits-tpl"> <p>name: <input data-bind="value: name" /></p> <p>type: <input data-bind="value: color" /></p> </template> ko.components.register('fruits', { viewmodel: function(params) { this.name = params.name; this.color = params.color; }, template: { element: 'fruits-tpl' } }); i'm using component view model below, items in observable list of different types , have different properties: function fruit(data) { this.name = ko.observable(data.name); this.color = ko.observable(data.color); } function dessert(data) { this.name = ko.observable(data.name); this.packaging = ko.observable(data.packaging); } function vm(){ var data = [{name:"apples",color:"yellow"},{name:"cookies",packaging:"box"}]; this.items = ko.observablearray([new fruit(dat...