【发布时间】:2016-12-13 19:03:22
【问题描述】:
我正在尝试将 iframe 源设置为 base64 数据包含以下格式的 PDF,
JS
$http.get('../../xyz', { token: $scope.token})
.success( function(response) {
$scope.reportBase64String = 'data:application/pdf;base64,' + response.data;
});
HTML
<iframe id="report" ng-src="{{reportBase64String}}"></iframe>
错误
$sceDelegate 策略不允许从 url 加载资源。
【问题讨论】: