Currently, I am attempting to dynamically alter the src of an iframe using Angular 2. Here is what I have tried:
HTML
<iframe class="controls" width="580" height="780" src="{{controllerSrc}}" frameborder="0" allowfullscreen></iframe>
COMPONENT.TS
import { Component, OnInit } from '@angular/core';
declare var jQuery: any;
const $ = jQuery;
export class VideoplayerComponent implements OnInit {
controllerSrc: string;
ngOnit(){
$('.button1').click(function(){
this.controllerSrc = 'https://www.videoindexer.ai/embed/insights/0c7357bd5c/?widgets=people';
});
}
}
Unfortunately, I encountered an error which reads:
ERROR Error: unsafe value used in a resource URL context (see http://g.co/ng/security#xss)
I'm uncertain how else I can approach this issue. Any guidance or assistance would be greatly appreciated.
Thank you