bsatrom / Knockout.Unobtrusive

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

Add convention to auto-map ViewModel properties to View elements #1

Open bsatrom opened 13 years ago

bsatrom commented 13 years ago

When ViewModel properties match View element's by id or name, auto-generate data-bind attributes based on that information. For example:

var viewModel = {
  name: ko.observable('');
};
<input type="text" id="name" />

Should add data-bind="value: name" to the input element, inferring the binding type value based on the element type