Goal/Background: I need to send the value of a variable from my Angular application to the ChatServer(aspx with javascript) that is inside an iFrame on the page. It is on a different server.
What I've tried: I am following the workaround here: https://stackoverflow.com/a/25098153/11187561
However, I am getting the error: Property 'contentWindow' does not exist on type HTMLElement
What else i've tried next: Looking through SO, I found https://stackoverflow.com/a/38457886/11187561
I placed it in ngAfterViewInit but I am still getting the error.
Code:
ngAfterViewInit() {
var frame = document.getElementById('your-frame-id');
frame.contentWindow.postMessage(/*any variable or object here*/, '*');
}