Loading / Error Substates

Loading / Error Substates

The Ember Router allows you to provide feedback that a route is loading, as well as when an error occurs in loading a route.

loading substates

During the beforeModel, model, and afterModel hooks, data may take some time to load. Technically, the router pauses the transition until the promises returned from each hook fulfill.

Consider the following:

app/router.js
Router.map(function() {
  this.route('slow-model');
});
app/routes/slow-model.js
import Ember from 'ember';

export default Ember.Route.extend({
  model() {
    return this.get('store').findAll('slow-model');
  }
});