February 2016
Beginner to intermediate
308 pages
5h 46m
English
A very important feature of routes is redirection. This recipe will go over using the transitionTo method.
In our route handler, we have special hooks called beforeModel and afterModel. We can use these hooks to perform actions before the model is loaded or after the model is loaded. The transitionTo method can be used to redirect the application to different routes.
students route:
$ ember g route students
This will generate the students route and template files.
// app/routes/students.js import Ember from 'ember'; export default Ember.Route.extend({ model() { return [1,2,3,4,5,6,7,8,9]; ...Read now
Unlock full access