I'm facing an issue in my Angular application where I need to open a new window and dispatch an event back to the controller. The code works fine on Chrome and Firefox, but unfortunately, it doesn't work on Edge.
Here is the code snippet from the external file:
try {
var ev = new Event('abc');
ev['data'] = model;
window.opener.dispatchEvent(ev);
} catch (e) {
alert(e);
}
While executing the code in the external window, I receive an alert displaying ERROR: invalid argument.
In the Angular component, I have the following listener set up:
@HostListener('window:abc', ['$event'])
I haven't found much helpful information in other answers. If anyone could provide guidance or solutions, I would greatly appreciate it.
Thank you.