Reputation: 1596
I have a component that contains a view. This view uses the {{input}} helper to render an Ember.TextField.
I have an action defined on the child view (not the component), which needs to be triggered on the escape-press
action emitted from the TextField. How do I target the current view using the {{input}} helper?
Here's a jsbin with the whole setup.
Upvotes: 0
Views: 141
Reputation: 2438
To tell a Component to send actions to a particular target object, set it's targetObject
property:
{{input escape-press="alert" targetObject=view placeholder="Press <esc> when focused"}}
I've updated the jsbin here to show it working.
(Also, your original jsbin had a typo in the WrapperView
- action
instead of actions
)
Upvotes: 3