使用ng-image-cache指令将图像保存在缓存中。Ng图像缓存不起作用
在我们的场景中,资产包含需要预加载的url列表,以便即使没有Internet连接也可以看到图像。
HTML如下:
<div ng-repeat="asset in assets">
<ui-image data-src={{asset}} data-title="{{asset}}"></ui-image>
</div>
text
包含HTML,我更换图像的情况下是这样的:
var imageUrl = text.substring(decypheredText.indexOf("\"") + 1, text.lastIndexOf("\""));
text.replace('img src', 'ui-image data-src')
.replace('>', ' data-title = "' + imageUrl + '"></ui-image>');
任何帮助,将不胜感激。提前致谢。
你的模块不保存图像为base64,对抗的值关键是图片网址。它应该是一个base64 URI。 – shrey
当模块无法在base64中正确序列化图像时,它将存储图像url以正确工作 –
您是什么意思?我在我的代码中启用了断点,但断点永远不会进入js中的base64转换代码。 – shrey