February 2016
Beginner to intermediate
308 pages
5h 46m
English
Occasionally, you'll need to retrieve data from a model for a template. The route is responsible for loading the appropriate model. This recipe will go over how to do this.
router.js file and add a new route. We'll call this route students:// app/router.js
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.route('students');
});
export default Router;The students route will retrieve data from the students route handler.
students route. This will create the students route handler and template:
$ ember g route students
students.js file, add a ...Read now
Unlock full access