I have an iframe inside a angular2 component, and I am trying to change the content of the iframe by accessing the contentWindow. The iframe should contain a simple butt
I solved the problem in the following way:
const element: HTMLIFrameElement = document.getElementById('iframe') as HTMLIFrameElement; const iframe = element.contentWindow; if (iframe !== null) { ... }