mardi 8 décembre 2015

Is it normal to invoke route.refresh() in willTransition hook?

This question is related to EmberJS best practice. I have two routes:

  1. /diners
  2. /diners/register

Now that I want to reload the model of /diners after transitioning from /diners/register (as a result of a successful diner registration, using transitionToRoute).

The questions are:

  • I use this.refresh() in actions: willTranstion; Is it normal? Should I do it this way?
  • What are other ways to refresh the model of parent routes after transitioning from a child route?
  • How can I can maintain the data consistency on client side when POSTing a new record to back end?

Ember version info:

DEBUG: Ember      : 1.13.11
DEBUG: Ember Data : 1.13.15
DEBUG: jQuery     : 1.11.3 




Aucun commentaire:

Enregistrer un commentaire