I have the following HTML code
<iframe #originalUrl [hidden]="!showOriginalDoc" [src]="originalUrl"><span *ngIf="originalUrl===''">Original URL Not Available</span></iframe>
following angular code
if(data.originalResearch.originalUrl===null)
this.originalUrl='';
else
this.originalUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(data.originalResearch.originalUrl);
the above code still throws the following error :
CuratorModalBodyComponent.html:123 ERROR Error: unsafe value used in a resource URL context (see http://g.co/ng/security#xss) at DomSanitizerImpl.vendor../node_modules/@angular/platform-browser/@angular/platform-browser.es5.js.DomSanitizerImpl.sanitize (platform-browser.es5.js?ffb0:3992) at setElementProperty (core.es5.js?0445:9398) at checkAndUpdateElementValue (core.es5.js?0445:9318) at checkAndUpdateElementInline (core.es5.js?0445:9252) at checkAndUpdateNodeInline (core.es5.js?0445:12357) at checkAndUpdateNode (core.es5.js?0445:12303) at debugCheckAndUpdateNode (core.es5.js?0445:13167) at debugCheckRenderNodeFn (core.es5.js?0445:13146)
I am Using angular 4.4.1