O'Reilly logo

Mastering Ember.js by Mitchel Kelonye

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

Defining route and resource handlers

Now that we have defined all the possible states that our application can transition into, we need to define handlers to these states. From this point onwards, we will use the terms route and resource handlers interchangeably. A route handler performs the following major functions:

  • Providing data (model) to be used by the current state
  • Specifying the view and/or template to use to render the provided data to the user
  • Redirecting an application away into another state

Before we move into discussing these roles, we need to know that a route handler is defined from the Ember.Route class as:

App.RouteHandlerNameRoute = Ember.Route.extend();

This class is used to define handlers for both resources and routes and therefore, ...

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