February 2016
Beginner to intermediate
308 pages
5h 46m
English
Often, in an application, we'll need to allow interaction with controls that affect the application state. To accomplish this, we'll use actions.
The {{action}} helper is used on HTML elements to send actions back to the template's corresponding controller or component when the user clicks on an element. Let's take a look at an example of this.
application directory, and type this command to generate a new component:
$ ember g component action-component
Keep in mind that all components must have a dash in their names. This will generate the component template, JavaScript files, and test files.
action-component.js file in the components folder. We'll add ...Read now
Unlock full access