February 2016
Beginner to intermediate
308 pages
5h 46m
English
Often, you'll have a list of items that you'll need to iterate over. We can iterate through these items with the each helper. This recipe will go over how to do this.
Let's say that we have a list of students and want to display them in our template. We'll use the each helper to accomplish this.
student controller and template:$ ember g template student $ ember g controller student
This will create the necessary files needed for our example.
router.js file with the new student route:// app/router.js
…
Router.map(function() {
this.route('student');
});This will add a new conditional route. To access this route using the Ember server, open a web browser and navigate to ...
Read now
Unlock full access