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));
}
}
window.addEventListener("message", () => {
this.receiveMessage();
}, false)
receiveMessage: any = (event: any) => {
//...
}