mercredi 27 janvier 2016

In Ember automatically route application to error route if template promise returns error

Given a route it is easy enough to get Ember to navigate to an error route if the model promise rejects. Currently I have the simple method of having an error.hbs and /routes/error.js, and if the model promise errors it loads the error page.

I have a situation where the model resolves fine, but one of its relationships does not. This relationship is used in the routes template e.g.

{{#each model.addresses as |address id|}}
  {{address.line1}}
{{/each}}

So http://ift.tt/1PDKs1A returns a 500 error. I see this in the console window, but Ember does not automatically transition to the error page. How can I get it to do this for all promises that reject as a result of a template requesting more data?




Aucun commentaire:

Enregistrer un commentaire