Hi,
When implementing the custom mapping option and returning an observable the observable is replaced on update instead of actually being updated. ie. If I implement a custom mapping for DOB that converts to a date in a specific way then on update it recreates the observable instead of updating and breaks all bindings on the page.
I sorted this out for the time being by modifying the recursiveUpdate function as below. I'm sure that the way I've done it is not the best, but it works for me and I've put it here just so you can see what I've done.
Original
unwrapped[p] = childMap(modelObj[p]);
Modified
if (isObservable(unwrapped[p])) {
if (isObservable(childMap(modelObj[p]))) {
unwrapped[p](childMap(modelObj[p])());
} else {
unwrapped[p](childMap(modelObj[p]));
}
} else {
unwrapped[p] = childMap(modelObj[p]);
}
Thanks.
Hi,
When implementing the custom mapping option and returning an observable the observable is replaced on update instead of actually being updated. ie. If I implement a custom mapping for DOB that converts to a date in a specific way then on update it recreates the observable instead of updating and breaks all bindings on the page.
I sorted this out for the time being by modifying the recursiveUpdate function as below. I'm sure that the way I've done it is not the best, but it works for me and I've put it here just so you can see what I've done.
Original
Modified
Thanks.