O'Reilly logo

Ember.js Cookbook by Erik Hanchett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required