I am getting undefined error while pushing new values into a array.
html:
<select id="temp" data-bind="options:Original"></select>
<select data-bind="options:dynamicaarry"></select>
viewModel:
var ViewModal=function(items) {
this.dynamicaarry=ko.observableArray(items);
this.Original=ko.observableArray(['volvo','saab','mercedes','audi']);
};
ko.applyBindings(new ViewModal(['four']));
$("#temp").change(function() {
this.ViewModal.dynamicaarry.push('six'); //throws undefined error});});
}
And is it possible to handle selectedindexchange event in knockout without using jquery ?