# Можно ли прикреплять обработчики событий к виджетам в теме/плагине?

**URL:** https://meta.discourse.org/t/possible-to-attach-event-handlers-to-widgets-in-theme-plugin/166204
**Category:** Development
**Created:** [04.Октябрь.2020 15:42:58 UTC](https://meta.discourse.org/t/possible-to-attach-event-handlers-to-widgets-in-theme-plugin/166204 "2020-10-04T15:42:58Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [04.Октябрь.2020 17:22:28 UTC](https://meta.discourse.org/t/possible-to-attach-event-handlers-to-widgets-in-theme-plugin/166204/5 "2020-10-04T17:22:28Z")

</div>

О виджете и компоненте:

> [@How different are Ember component and Discourse widget?](https://meta.discourse.org/t/how-different-are-ember-component-and-discourse-widget/154174/2):
>
> Components are broadly used across most of Discourse. Where widgets come in useful is on some of our most highly-trafficked elements, such as the topic post stream and the header with its multiple menus. You’ll often see widgets used in plugins and themes to add to or modify existing widgets. Take for example this widget in the discourse-calendar plugin: This is a button rendered in the original post of a topic. It needs to be a widget because the post itself is rendered as a widget for per…

---

_[View the full topic](https://meta.discourse.org/t/possible-to-attach-event-handlers-to-widgets-in-theme-plugin/166204)._
