Actions

Your app will often need a way to let users interact with controls that
change application state. For example, imagine that you have a template
that shows a blog title, and supports expanding the post to show the body.

If you add the
{{action}}
helper to any HTML DOM element, when a user clicks the element, the named event
will be sent to the template's corresponding component or controller.

With preventDefault=false omitted, if the user clicked on the link, Ember.js
will trigger the action, but the user will remain on the current page.

With preventDefault=false present, if the user clicked on the link, Ember.js
will trigger the action and the user will be directed to the new page.

Modifying the action's first parameter

If a value option for the
{{action}}
helper is specified, its value will be considered a property path that will
be read off of the first parameter of the action. This comes very handy with
event listeners and enables to work with one-way bindings.

The newValue parameter thus becomes the target.value property of the event
object, which is the value of the input field the user typed. (e.g 'Foo Fighters')

Attaching Actions to Non-Clickable Elements

Note that actions may be attached to any element of the DOM, but not all
respond to the click event. For example, if an action is attached to an a
link without an href attribute, or to a div, some browsers won't execute
the associated function. If it's really needed to define actions over such
elements, a CSS workaround exists to make them clickable, cursor: pointer.
For example:

[data-ember-action]:not(:disabled) {
cursor: pointer;
}

Keep in mind that even with this workaround in place, the click event will
not automatically trigger via keyboard driven click equivalents (such as
the enter key when focused). Browsers will trigger this on clickable
elements only by default. This also doesn't make an element accessible to
users of assistive technology. You will need to add additional things like
role and/or tabindex to make this accessible for your users.