【发布时间】:2018-07-12 04:14:05
【问题描述】:
大家好,我想展示一个动态的 pdf。起初它向我显示 CORS 错误。我使用 DOM Sanitizer 解决了这个问题。现在它向我显示不安全的 url 任何帮助表示赞赏。
HTML 代码:
<iframe src="{{Url}}"></iframe>
TS Code : 这里pdfSrc存放动态生成的pdf路径;
this.pdfSrc = 'http://192.168.1.183/' + this.pdfPath;
this.Url = this.sanitizer.bypassSecurityTrustUrl(this.pdfSrc);
【问题讨论】:
-
Follow this link angular.io/api/platform-browser/DomSanitizer use this bypassSecurityTrustResourceUrl
-
已经试过了让我试试安全管
标签: angular typescript iframe