coderenaissance / knockout.viewmodel

The knockout viewmodel plugin is the fastest, smallest, cleanest, most flexible way to create a knockout viewmodel.
http://coderenaissance.github.com/knockout.viewmodel
105 stars 27 forks source link

Have options for better customizing toModel / fromModel #57

Open josche-duplicate opened 10 years ago

josche-duplicate commented 10 years ago

I have a scenario where we have a complex data model for managing data / state during a workflow, the issue is a complex object property is null initially but is checked during the workflow, this is done for simplification. The problem is that during the initial process, these properties are converted to observable nulls during one execution path, and an object with nested child observables when executed from a different logic path. This breaks the functionality of updateFromModel. I first tackled this issue by attempting to clean out knockout bindings but ran into many other issues. It would simpler and cleaner to have the ability to ignore properties, and/or some means to not convert properties that are null.