如题,请大神赐教
1 回答
郎朗坤
TA贡献1921条经验 获得超9个赞
我找到解决方法了,分享一下 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>
- 1 回答
- 0 关注
- 529 浏览
添加回答
举报
0/150
提交
取消