I am Creating a iframe Dynamically in Angular in ngOninit.
ngOnInit(){
const el = document.createElement('iframe');
el.setAttribute('sandbox', '');
}
And then using ElementRef in ngAfterViewInit i am trying to access the dynamically created component.
this.elRef.nativeElement.querySelector('iframe');
But if gives me null always , how to get the reference of the element here, i even tried with afterContentInit nothing works.