# How do actions in components get defined and triggered?

**URL:** <https://discuss.emberjs.com/t/how-do-actions-in-components-get-defined-and-triggered/9163>\
**Category:** Uncategorized\
**Created:** [November 23, 2015, 7:22pm UTC](https://discuss.emberjs.com/t/how-do-actions-in-components-get-defined-and-triggered/9163 "2015-11-23T19:22:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaellee](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/michaellee/32/9882_2.png) [@michaellee](https://discuss.emberjs.com/u/michaellee)\
**Post date:** [November 23, 2015, 7:22pm UTC](https://discuss.emberjs.com/t/how-do-actions-in-components-get-defined-and-triggered/9163/1 "2015-11-23T19:22:57Z")

</div>

Forgive me if this has been answered elsewhere or if I’m not finding it in the documentation, but how are actions defined in components now triggered?

In pre-component fashion I could just bind an action to any HTML element and then define it in a controller.

```auto
// hbs
<h3>Something awesome will happen when you click here</h3>
<div {{action "doSomething"}}>Do something when clicked</div>

```

```auto
// controller
...
actions: {
  doSomething (){
    //Something spectacular!
  }
}
...

```

I can’t seem to figure out how to do something similar with components.

Let’s say, I’ve extracted what was in the `.hbs` and put it into a component

```auto
// component hbs
<h3>Something awesome will happen when you click here</h3>
<div {{action "doSomething"}}>Do something when clicked</div>

```

And all I want to do is transition to a different route from where the current component is used. Where does the action need to be defined and/or what is the pattern to define actions? Let’s assume that the component is a child component of another component.

---

<div class="post-metadata">

**Author:** ![michaellee](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/michaellee/32/9882_2.png) [@michaellee](https://discuss.emberjs.com/u/michaellee)\
**Post date:** [November 23, 2015, 7:36pm UTC](https://discuss.emberjs.com/t/how-do-actions-in-components-get-defined-and-triggered/9163/2 "2015-11-23T19:36:31Z")

</div>

I was able to figure it out. @emberigniter’s article on [http://emberigniter.com/send-action-does-not-fire/](http://emberigniter.com/send-action-does-not-fire/) and the diagram under the section for routing in this article helped tremendously [http://emberigniter.com/5-essential-ember-2.0-concepts/](http://emberigniter.com/5-essential-ember-2.0-concepts/)
