jeudi 30 avril 2015

Get value from emberjs form

I'm a newbie with Emberjs and I need some advices.

I try to use this addon http://ift.tt/1s8q7EZ

So I have created my form :

 {{#em-form model=sessions submit_button=false}}
    {{em-input property="email" type=email label="Email" placeholder="Entrer votre email..."}}
    {{em-input property="password" type="password" label="Mot de passe" placeholder="Enter votre password..."}}
    <div class="form-actions">
      <input {{bind-attr disabled=isntValid}} type="submit" class="btn btn-primary" value="Se connecter">
    </div>
 {{/em-form}}

so I have a controller to catch the submit action :

export default Ember.Controller.extend({
 actions: {
  submit: function(){
   alert(this.get('sessions.email'));
  }
 }
});

My question is just I don't get it to how print my value from my form? I try this.get('email') or this.get('sessions.email') but always got an undefined in my alert box

Any help would be great! Thanks!




Aucun commentaire:

Enregistrer un commentaire