I am very new to knockoutjs I got the error "The argument passed when initializing an observable array must be an array,or null,or undefined.I don't have an idea how to solve it.Can any one help me please.
viewModel = function ()
{
var self = this;
self.rows = ko.observableArray([]);
self.items = ko.observableArray(childData.items);
self.otherCharges = ko.observableArray(childData.otherCharges);
self.add = function (type) {
var entry = new Entry({});
entry.SNo(VMRows().length);
entry.Type(type);
self.rows.push(entry);
};
self.remove = function (entry) {
self.rows.remove(entry);
i = 0;
ko.utils.arrayForEach(VMRows, function (e) {
e.SNo(i++);
});
};
};
VM[container] = new viewModel();
var VMRows = VM[container].rows;
viewModel).