6
rated 0 times
[
8]
[
2]
/ answers: 1 / hits: 8100
/ 7 Years ago, thu, november 9, 2017, 12:00:00
Im trying to dynamically change the src of an iframe using angular 2 Ive 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';
});
}
}
but Im getting an error that says
ERROR Error: unsafe value used in a resource URL context (see http://g.co/ng/security#xss)
not sure how else I can do this, any help would be appreciated,
Thanks
More From » angular