February 2016
Beginner to intermediate
308 pages
5h 46m
English
Actions are important to controllers. They are triggered by the user action and can be used to change the application state. In this recipe, we'll create four different types of actions and see how they react to different situations.
$ ember g controller application $ ember g route application
We'll be using the controller and application to store actions. Some actions will bubble up to the route, and some won't.
// app/controllers/application.js import Ember from 'ember'; export default Ember.Controller.extend({ actions: { action1(){ alert('Application controller action action1'); }, action2(){ ...Read now
Unlock full access