One of the most useful helpers that Ember.js provides is the link-to helper. We'll discuss how to use this helpful feature in this recipe.
The link-to helper is used to navigate an Ember application. The first argument is always the name of the route. The second is the dynamic segment. We'll discuss dynamic segments a little later.
One of the simplest ways to use the link-to helper is to use it inline.
Create a new student application and route. Run this command in the root of the
project
directory:$ ember g route students
Ember CLI will generate a new route called students. This will update the
router.js
file as well as add the template and route files.Open the
students.hbs
file in theapp/templates
folder and add this string to it:// app/templates/students.hbs Hi from the students route {{outlet}}
This message will be displayed after navigating to the
students
route.Open the
application.hbs
file. Let's add alink-to
helper:// app/templates...