vendredi 12 février 2016

Ember.js property displayed as a string

In my index.js controller , I save an email address and then I display a message ...

actions: {
  saveInvitation() {
    const email = this.get('emailAddress');
    const newInvitation = this.store.createRecord('invitation', { email: email });
    newInvitation.save();
    this.set('responseMessage', "Thank you! We\'ve just saved your email address: ${this.get('emailAddress')}");   
    this.set('emailAddress', '');
  }
}

When I register an email address : john doe@example.com The email address is correctly stored in the db, however the displayed message is :

Thank you! We have just saved your email address: ${this.get('emailAddress')}

rather than

Thank you! We have just saved your email address: john doe@example.com

what's wrong ? thanks for tips




Aucun commentaire:

Enregistrer un commentaire