# How do I listen to the VideoClient events in angular?

**URL:** <https://devforum.zoom.us/t/how-do-i-listen-to-the-videoclient-events-in-angular/57450>\
**Category:** Web\
**Created:** [September 14, 2021, 8:07pm UTC](https://devforum.zoom.us/t/how-do-i-listen-to-the-videoclient-events-in-angular/57450 "2021-09-14T20:07:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![devagyas900](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/devagyas900/32/31064_2.png) [@devagyas900](https://devforum.zoom.us/u/devagyas900)\
**Post date:** [September 14, 2021, 8:07pm UTC](https://devforum.zoom.us/t/how-do-i-listen-to-the-videoclient-events-in-angular/57450/1 "2021-09-14T20:07:15Z")

</div>

**Description**  
When an event takes place, say a user is added to the meeting, an event “user-added” occurs to which the client.on() function listens. How do I listen to these events in angular?  
Angular does not allow me to directly call a function inside of a component and I can’t call it outside of it as my videoClient object exists only inside the components.  
Please help.

**Error**  
N/A

**Which Web Video SDK version?**  
VideoSDK 1.1.4

**To Reproduce(If applicable)**  
N/A

**Screenshots**  
N/

**Device (please complete the following information):**  
N/A

**Additional context**  
In the documentation the client.on() functions are just called from inside of the script. So that didn’t help me at all.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 15, 2021, 9:02pm UTC](https://devforum.zoom.us/t/how-do-i-listen-to-the-videoclient-events-in-angular/57450/2 "2021-09-15T21:02:23Z")

</div>

Hey @devagyas900 ,

You can add the event listeners in your Angular constructor function. Example:

```auto
constructor() {
    this.client.on('user-added',(payload)=>{
    // You can refresh the participants when
    const participants = this.client.getParticipantsList();
   })
}

```

Let me know if that helps! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![devagyas900](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/devagyas900/32/31064_2.png) [@devagyas900](https://devforum.zoom.us/u/devagyas900)\
**Post date:** [September 16, 2021, 9:18am UTC](https://devforum.zoom.us/t/how-do-i-listen-to-the-videoclient-events-in-angular/57450/3 "2021-09-16T09:18:49Z")

</div>

Thanks a lot, @tommy  
It works.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 16, 2021, 2:46pm UTC](https://devforum.zoom.us/t/how-do-i-listen-to-the-videoclient-events-in-angular/57450/4 "2021-09-16T14:46:08Z")

</div>

You are welcome! 🙂

-Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 17, 2021, 12:46am UTC](https://devforum.zoom.us/t/how-do-i-listen-to-the-videoclient-events-in-angular/57450/5 "2021-10-17T00:46:29Z")

</div>

Closed on October 17, 2021, 12:46am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
