Handle Actions

Similar to how a component can render its own content and accept content from the calling template (or component), a component can define its own actions, or it can refer the action back to the calling context.

It’s easy to see why this feature exists. In certain cases, such as UI manipulation for the component’s UI, you’d prefer not to rely on the calling context, or even allow the calling context to see what you’re doing. In other cases, such as navigation, you want the calling context to define the expected behavior.

And there are some use cases that lie in the middle, such as saving a record. If you have passed the entire record into the component, you can save it there. Otherwise, you might have to save it in the calling ...

Get Deliver Audacious Web Apps with Ember 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.