O'Reilly logo
  • Todd Schavey thinks this is interesting:

self.children.push(self.newChild());

From

Cover of Getting Started with Knockout.js for .NET Developers

Note

This is not working for some reason. The browser console reports: 07:59:42.155 TypeError: self.children.push is not a function1 PersonalPage.html. The ViewModel does have a children variable that is set to ko.observable(person.children). The page loads just fine..but only when I hit the Add button does this get reported. When I change it to this it works:
self.addChild = function(){
if(self.addChildEnabled){
innerArray = self.children();
innerArray.push(self.newChild());
self.children.valueHasMutated();
self.newChild("");
}
}