import { Injectable } from "@angular/core" ; import { Subject } from "rxjs" ; @ Injectable ( { providedIn : "root" } ) export class EventBusProvider { public $subject : Subject < { key : string ; data ? : any ; } > = new Subject ( ) ; constructor ( ) { } emit ( key , data ? ) { this . $subject . next ( { key , data } ) ; } }