Angular2+ – Test fromEvent subscribe on jquery / bootstrap event [closed]

I wanted to test this part of code :

ngAfterViewInit(): void {
  this.sub = fromEvent($(#myModal), 'hide.bs.modal').subcribe( () => {
    // some stuff
    this.ngzone.run( () => {} ); // force view to refresh because the event is out of angular scope
  }
}

So this is a bootstrap jquery event to hide the #myModal that is a bootstrap modal and i wanted to test it but i dont figure out how to enter in th fromEvent sub in order to execute the stuff in it.

Any idea, how i can generate the fromEvent ‘hide.bs.modal’ from the $(‘#myModal’) element?

Source: Angular Questions