I would like to create a knockout custom binding (so I can add a computed observable) as with this example:
var mapping = {
'children': {
create: function(options) {
return new myChildModel(options.data);
}
}
}
The problem is, my viewModel is the actual array (the root). Not a child property as 'children' in this example. So I need something like:
var mapping = {
'root': {
create: function(options) {
return new myChildModel(options.data);
}
}
}
How can I achieve that? Thank you.