# إضافة بيانات "opts" إضافية إلى حدث "DiscourseEvent.on(:post\_created)" من جافا سكريبت؟

**URL:** <https://meta.discourse.org/t/adding-extra-opts-data-to-the-discourseevent-on-post-created-event-from-javascript/84889>\
**Category:** Development\
**Created:** [9 أبريل 2018، 4:05م UTC](https://meta.discourse.org/t/adding-extra-opts-data-to-the-discourseevent-on-post-created-event-from-javascript/84889 "2018-04-09T16:05:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [11 أبريل 2018، 9:53م UTC](https://meta.discourse.org/t/adding-extra-opts-data-to-the-discourseevent-on-post-created-event-from-javascript/84889/6 "2018-04-11T21:53:18Z")

</div>

> [@Vespura](#):
>
> However, it after pressing the button the variable changes, but the variable in your code does not get updated because it only updates once the editor is re-opened or the post is being edited

When the property is set depends on how you’re setting it. Post your code for that here, i.e. whatever you’ve put inside `api.modifyClass('model:composer', {})`.

Keep in mind that when you’re modifying a class on the client, you’re using Ember. If you haven’t already, I suggest a quick peruse of the [Ember Guide](https://guides.emberjs.com/v2.15.0/) to see the various hooks and methods available to you in a model, or the controller.

---

_[View the full topic](https://meta.discourse.org/t/adding-extra-opts-data-to-the-discourseevent-on-post-created-event-from-javascript/84889)._
