Changelog

JavaScript Icon changelog.com

Ember.js forms made easy with EasyForm

logged by @logbot 2013-03-04T15:38:58Z permalink #javascript

Brian Cardarella recently open sourced Ember EasyForm, an Ember.js library to make working with forms less tedious.

By wielding the library you can turn a form like this:

<form>
  <div class="input string">
    <label>First name</label>
    {{view Ember.TextField valueBinding='firstName' name='first_name' viewName='firstNameField'}}
  </div>
  <div class="input string">
    <label>Last name</label>
    {{view Ember.TextField valueBinding='firstName' name='last_name' viewName='lastNameField'}}
  </div>
  <div class="input string">
    <label>Age</label>
    {{view Ember.TextField valueBinding='age' name='age' viewName='ageField'}}
  </div>

</form>

Into this:

{{#formFor controller}}
  {{input firstName}}
  {{input lastName}}
  {{input age}}
  {{submit}}
{{/formFor}}

Brian's intro post says it is a work-in-progress and encourages people to submit their feature ideas as GitHub issues. The library uses semantic versioning and hasn't hit 1.0 yet, but it shows a lot of promise.

If you're using Ember now is a great time to get involved!

0:00 / 0:00