I am creating post app using wp rest api v2. That’s holding youtube video url(s) in iframe.
So i am sanatizing youtube url then it’s throwing error
Uncaught (in promise): TypeError: Cannot read property ‘bypassSecurityTrustResourceUrl’ of undefined TypeError
Have a look of my code
export class SinglePage {
datas:any = ;
comments:any;
constructor(private navCtrl: NavController, params: NavParams, private http: Http, private sanitizer: DomSanitizer) {
this.datas.sanitizer.bypassSecurityTrustResourceUrl(“https://youtube.com”);
this.http.get(params.data.url+“/?_embed”).subscribe(data=>{this.datas.push(data.json()); this.http.get(data.json()._links.replies[0].href).subscribe(comment=>{ this.comments = comment.json() }); });
}
}
Please help me out into this.
Thanks in advance