如何将从 PouchDB 附件中恢复的 Blob 显示为 ngSrc?
How to show a recovered Blob from PouchDB attachment as ngSrc?
我很难在 PouchDB's Working with attachments Page 之后将 blob 显示为 ngSrc
。我的相关 html 是:
<img src="" ng-src="{{$root.images.myImgNameX}}" alt="">
它被编译成这样:
<img src="http://localhost:8100/fcba0867-bf49-4fe0-b4f2-3490bb65761f" ng-src="blob:http://localhost:8100/fcba0867-bf49-4fe0-b4f2-3490bb65761f" alt="">
但是没有显示图像。但是,如果我将 url 复制并粘贴到 ng-src
中,我可以看到图像。
我收到此错误:
:8100/#/app/news:1 Refused to load the image 'blob:http://localhost:8100/754f38af-0246-4b33-85c9-049f6d9ce1df' because it violates the following Content Security Policy directive: "img-src 'self' data: *".
如何在我的 img
标签中使用 blob
?
我在此处找到了解决错误的解决方案:
我将 img-src 'self' blob:
添加到我的 <meta http-equiv="Content-Security-Policy">
标签
我很难在 PouchDB's Working with attachments Page 之后将 blob 显示为 ngSrc
。我的相关 html 是:
<img src="" ng-src="{{$root.images.myImgNameX}}" alt="">
它被编译成这样:
<img src="http://localhost:8100/fcba0867-bf49-4fe0-b4f2-3490bb65761f" ng-src="blob:http://localhost:8100/fcba0867-bf49-4fe0-b4f2-3490bb65761f" alt="">
但是没有显示图像。但是,如果我将 url 复制并粘贴到 ng-src
中,我可以看到图像。
我收到此错误:
:8100/#/app/news:1 Refused to load the image 'blob:http://localhost:8100/754f38af-0246-4b33-85c9-049f6d9ce1df' because it violates the following Content Security Policy directive: "img-src 'self' data: *".
如何在我的 img
标签中使用 blob
?
我在此处找到了解决错误的解决方案:
我将 img-src 'self' blob:
添加到我的 <meta http-equiv="Content-Security-Policy">
标签