“Cara Menerima Window.PostMessage Event di Angular 9” Kode Jawaban

Cara Menerima Window.PostMessage Event di Angular 9

window.addEventListener("message", () => {
   this.receiveMessage();
}, false)
Frail Falcon

Cara Menerima Window.PostMessage Event di Angular 9

constructor(private _authService: AuthService, private _router: Router) { 
   if (window.addEventListener) {
     window.addEventListener("message", this.receiveMessage.bind(this), false);
   } else {
      (<any>window).attachEvent("onmessage", this.receiveMessage.bind(this));
   }
}
Frail Falcon

Cara Menerima Window.PostMessage Event di Angular 9

receiveMessage: any = (event: any) =>  {
  //...
}
Frail Falcon

Jawaban yang mirip dengan “Cara Menerima Window.PostMessage Event di Angular 9”

Pertanyaan yang mirip dengan “Cara Menerima Window.PostMessage Event di Angular 9”

Lebih banyak jawaban terkait untuk “Cara Menerima Window.PostMessage Event di Angular 9” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya