# איך לדעת אם הדף נטען ברכיב תמה / ווידג'ט?

**URL:** <https://meta.discourse.org/t/how-to-tell-if-page-is-loading-in-theme-component-widget/190190>\
**Category:** Development\
**Created:** [12 במאי,‏ 2021,‏ 1:41pm UTC](https://meta.discourse.org/t/how-to-tell-if-page-is-loading-in-theme-component-widget/190190 "2021-05-12T13:41:26Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [19 במאי,‏ 2021,‏ 4:11pm UTC](https://meta.discourse.org/t/how-to-tell-if-page-is-loading-in-theme-component-widget/190190/8 "2021-05-19T16:11:04Z")

</div>

> [@Zach\_Swinehart](#):
>
> awareness of whether or not the global Discourse app is loading a new page.

I think to hack into the [discovery](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/routes/discovery.js) route by using the `modifyClass` API then trigger some custom event would work.

[https://api.emberjs.com/ember/3.12/classes/Route](https://api.emberjs.com/ember/3.12/classes/Route)

> [@Zach\_Swinehart](#):
>
> I see in app\assets\javascripts\discourse\app\templates\discovery.hbs that the div container observes a “loading” var, but I can’t figure out where that comes from and how to “tap in” to that or observe the loading state in my widget.

The `loading` variable comes from the `discovery` route that I mentioned above, the widget attached to plugin-outlet may not able to access it since it doesn’t pass as an argument, it depends on the definition of plugin-outlet.

---

_[View the full topic](https://meta.discourse.org/t/how-to-tell-if-page-is-loading-in-theme-component-widget/190190)._
