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

Chapter 5. Controllers

In the previous chapter, we discussed how templates in Ember.js are used to present data to users. We also covered how user interactions, in our applications, are easily made possible through these templates. We noted that templates serve their purpose by communicating with controllers. This chapter will expound on this, and will cover the following topics:

  • Defining controllers
  • Storing models and objects in controllers
  • Using object and array controllers
  • Specifying controller dependencies
  • Registering action handlers in controllers
  • State transitions in controllers

Defining controllers

Just like route handlers, a controller can be defined by extending the Ember.Controller class, as shown in the following line of code:

AppNamespace.ControllernameController ...

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