Working with HTML links inside templates

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.

How to do it...

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.

  1. 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.

  2. Open the students.hbs file in the app/templates ...

Get Ember.js Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.