lundi 25 avril 2016

Ember Data: Best practice creating new record

I was wondering what the best practices when a creating a new record in a ember data application.

Witch following strategy is considered best practices?

Strategy 1

  • Model hook returns the promise from this.store.createRecord();
  • Each template fields is mapped to the model return by the model hook.
  • Action saves the model.

Strategy 2

  • Each template field is mapped to a controller property.
  • Action calls this.store.createdRecord() and save the model.



Aucun commentaire:

Enregistrer un commentaire