Reputation: 83
I am binding a link in iframe src as below
public resultLink: SafeResourceUrl;
this.resultLink = this.domSanitizer.bypassSecurityTrustResourceUrl(searchResult.pageUrl);
<iframe title="Finder Results" [src]="resultLink"></iframe>
But I am getting following output
<iframe title="Finder Results" src="SafeValue must use [property]=binding: www.testurl.com (See https://g.co/ng/security#xss)"></iframe>
How can we fix this?
Upvotes: 0
Views: 216
Reputation: 6801
It could related to safeUrl
:
<iframe title="Finder Results" [src]="resultLink | safeUrl"></iframe>
Upvotes: 0