You should implement AfterViewInit in the component where the iframe is located. Get this iframe's native element and implement the onload function.
@Component({
selector: 'app-component-iframe',
template: `<iframe #iFrameId [src]="url"`
})
export class ComponentIframe implements AfterViewInit {
@ViewChild('iFrameId') iframe: ElementRef;
ngAfterViewInit(): void {
const iFrameElement = this.iframe.nativeElement as HTMLIFrameElement;
iFrameElement.onload = () => {
console.log('content is loaded');
};
}
}
If you get that the iframe is not available on afterviewinit you can add a timeout and do the same.