I am unable to get the knockout.js mapping options to work on nested values. With the following code, the first level "shouldBeCopied" works fine and the nested "shouldBeCopied" value is always an observable.
var data = {
shouldBeCopied: "copied",
nested: {
shouldBeCopied : "copied"
}
};
var vm = ko.mapping.fromJS(data, {
'copy': ["shouldBeCopied"],
"nested": {
'copy': ["shouldBeCopied"]
}
});
console.log(vm);
Any ideas?
Here's a fiddle if anyone wants to play around with it.