Looking for ember.js Answers? Try Ask4KnowledgeBase
Looking for ember.js Keywords? Try Ask4Keywords

ember.jsComponent - communication between child to parent component.


Syntax

  • (yield -- Allows you to export items from a component
  • (hash -- Allows you to export a hash or object, since this is required to call child components within the parent's block. The requirement is that there is a . for the component to be created
  • (component -- Creates the child component which can take anything in the parent's context. The component can be curried, since it is only called when the user uses it, so add as many attributes as you need, and the user can add the rest.
  • (action -- Creates an action based on a function or a string pointing to a function in the actions hash of the parent component in this case.

Remarks

For creating components that interact with a parent component, composable components are the best option, although they require Ember 2.3+.