bsatrom/Knockout.Unobtrusive — Issue #13: Possible to honor data type of view model?
Author: DrZim
Created: 2011-10-28 21:29:06+00:00
State: open

You can bind a numeric view model property to an input which stays a number until the user changes it. The moment they change it, it stores the value as a string (even if they typed a number.)

Any way to add meta data to the bindings so that numbers stay numbers, dates stay dates, etc?

Otherwise, I end up creating three models on the server: 1) an object where all properties are string, 2) an object with the proper data types, and 3) POCOs with the proper data types. There's one extra unnecessary data model in that mix. (Of course, I could take the string values and submit them to a control function which accepts strings and outputs POCOs... Just thought of that.)

Either way, I am interested in the response to meta data options.