So empfangen Sie Fenster.PostMessage -Ereignis in Angular 9
window.addEventListener("message", () => {
this.receiveMessage();
}, false)
Frail Falcon
window.addEventListener("message", () => {
this.receiveMessage();
}, false)
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));
}
}
receiveMessage: any = (event: any) => {
//...
}