February 2016
Beginner to intermediate
308 pages
5h 46m
English
When routes are loading or there's an error, we have the ability to let the user know what's happening. This recipe will go over the basics on how to do this.
students route:
$ ember g route students
The ember generate command will create all the necessary files for the students route.
students.js file in the app/routes folder. Add a new model to return:// app/routes/students.js
import Ember from 'ember';
export default Ember.Route.extend({
model(){
return new Ember.RSVP.Promise(function (resolve, reject) {
Ember.run.later((function() {
resolve( [1,2,3,4,5,6,7,8,9]);
}), 2000);
});
}
});In our route file, we are returning an Ember RSVP promise. This promise resolves ...
Read now
Unlock full access