# Action from nested component to parent component

**URL:** <https://discuss.emberjs.com/t/action-from-nested-component-to-parent-component/7963>\
**Category:** Uncategorized\
**Created:** [May 10, 2015, 4:00pm UTC](https://discuss.emberjs.com/t/action-from-nested-component-to-parent-component/7963 "2015-05-10T16:00:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bauke](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/bauke/32/12190_2.png) [@Bauke](https://discuss.emberjs.com/u/Bauke)\
**Post date:** [May 10, 2015, 4:00pm UTC](https://discuss.emberjs.com/t/action-from-nested-component-to-parent-component/7963/1 "2015-05-10T16:00:02Z")

</div>

I can’t get this to work. In a route template I have two components, x-parent and a nested x-child component.

```auto
{{#x-parent}}
  {{x-child}}
{{/x-parent}}

```

Whenever I send an action from x-child, I want it to be caught by x-parent.

```auto
//x-child
this.sendAction('activateMe', this);

//x-parent
actions: function() {
  activateMe: function(child) {
    console.log('activate ' + child.get('name'));
  }
}

```

I tried messing around with parentView but no results.

---

<div class="post-metadata">

**Author:** ![amk](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/amk/32/9116_2.png) [@amk](https://discuss.emberjs.com/u/amk)\
**Post date:** [May 10, 2015, 6:20pm UTC](https://discuss.emberjs.com/t/action-from-nested-component-to-parent-component/7963/2 "2015-05-10T18:20:54Z")

</div>

The context inside `{{#x-parent}}` in your example not the parent component, but rather the surrounding controller.

If you were to do `{{x-parent}}` it would be what you want. Or you could `{{yield this}}` inside the parent’s template. and do `{{#x-parent as |parent|}}`, like [this](http://jsfiddle.net/amk221/xw8z2ob8/). I suppose it depends how much you want to couple the parent and child, because like you say, you could use parentView

---

<div class="post-metadata">

**Author:** ![Bauke](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/bauke/32/12190_2.png) [@Bauke](https://discuss.emberjs.com/u/Bauke)\
**Post date:** [May 10, 2015, 7:02pm UTC](https://discuss.emberjs.com/t/action-from-nested-component-to-parent-component/7963/3 "2015-05-10T19:02:47Z")

</div>

Thank you, that did it! It’s quite a confusing topic and there is a lot debate about the direction Ember should go. For now, this will do.
