how to receive window.postmessage event in angular 9
window.addEventListener("message", () => {
this.receiveMessage();
}, false)
receiveMessage: any = (event: any) => {
//...
}
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));
}
}
Also in JavaScript:
- creating function in node js
- generate express app
- javascript format number with commas
- firestore javascript delete document
- jsx full form
- sort date array javascript
- node js event emitter
- javascript set select option
- how to setstate in parent in child component in react native
- javascript node has parent with class
- how to make a div sticky using js
- get selected option text jquery
- javascript tofixed 2
- get image file width javascript
- Node require module
- how to print to console javascript
- how to export module in node js
- Syntax Error: Thread Loader (Worker 0) .eslintrc.js: Environment key "es2021" is unknown at Array.forEach (<anonymous>)
- call() vs apply() vs bind()
- npm run test:coverage command in jest
- js map value in range
- javascript filter and order
- detecting change in animated value react native
- es6 array sum javascript