Define Your Routes

As noted previously, each route corresponds to a given URL in your app. We defined four routes in our application with the following URLs:

  • http://localhost:4200

  • http://localhost:4200/register

  • http://localhost:4200/login

  • http://localhost:4200/notebooks

We defined register in the first chapter, and we generated the classes for login and notebook just now. The names and paths of these routes correspond to the definitions in router.js.

You may be wondering when we defined the root URL. The answer is that we defined it when we created the application. This route, known as the application route, uses Ember’s default implementation of the Route class. We modified a file called application.hbs in the first chapter. This file contains ...

Get Deliver Audacious Web Apps with Ember 2 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.