Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to receive window.postmessage event in 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));
   }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #receive #event #angular
ADD COMMENT
Topic
Name
7+1 =