Iframe Angular SRC wykrywa zmiany
/// HTML
// <iframe *ngIf="src" [src]="src" #iframeYoutube
// frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
// allowfullscreen></iframe>
@ViewChild('iframeYoutube') iframeYoutube: ElementRef;
ngOnChanges(changes: SimpleChanges): void {
this.src = changes['source'].currentValue;
if (this.iframeYoutube) {
this.iframeYoutube.nativeElement.src = this.src;
}
}
loonix