郎朗坤
我找到解决方法了,分享一下
controller层
$http.get(url,{responseType: 'arraybuffer'})
.then(function (msg) { var file = new Blob([msg.data], {type: 'application/pdf'}); var fileURL = URL.createObjectURL(file);
$scope.content=$sce.trustAsResourceUrl(fileURL);
});
html层
<div class="modal-content" onloadstart="">
<object ng-show="content" data="{{content}}" type="application/pdf" style="width: 100%; height: 1000px;"></object>
</div>