bsatrom / Knockout.Unobtrusive

Unobtrusive View to ViewModel bindings for KnockoutJS
http://bsatrom.github.com/Knockout.Unobtrusive/
44 stars 1 forks source link

Possible to honor data type of view model? #13

Open DrZim opened 12 years ago

DrZim commented 12 years ago

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.