When developing form fields in ember.js, it appears to involve a multi-step process. For instance, I define the form fields:
{{input value=email type="email" placeholder="Email" required="required"}}
{{input value=password type="password" placeholder="Password" required="required"}}
then in my controller, it looks like this:
App.AccountController = Ember.ObjectController.extend({
email: null,
password: null,
actions: {
login: function() {
var data = this.getProperties("email", "password");
console.log(data);
}
}
});
Essentially, email and password are first set to null at the top, and then again assigned in the 'data' variable to capture the entered values when the user fills out the fields.
Is there a more streamlined way to achieve this? Is it possible to set all field values to null with just one line of code, and then retrieve all the form field values in one go? Maybe something akin to serializing a form in jQuery?