Open 5amfung opened 9 years ago
I'm using ionic. I followed the instruction to config in the angular config section and calling $init() in the run section. I also looked at the source code (https://github.com/jBenes/angular-imgcache.js/blob/master/angular-imgcache.js#L69) and the code is doing the right thing. In fact, when I test without using the directive, it worked. So I can't quite figure out how a directive would be different from calling the API directly. Very baffling.
Hi, @5amfung I'm experiencing the same issue. Have you found a fix or workaround for ic-src ?
No, I did not figure it out.
Don't know why it works one way but not another, however a work around for browser is to install this plug in: https://chrome.google.com/webstore/detail/cors-toggle/omcncfnpmcabckcddookmnajignpffnh?hl=en
+1
I submitted PR #24 as a workaround for this issue. In the case cross-domain policy prevents from loading image, this change provides a fallback behavior that consists in displaying directly pictures without caching them (in my use case it is better than a broken image).
I was able to load and cache the image file using
ImgCache.cacheFile()
from imgcache.js. However, when I switch to using theimg-cache
directive like<img img-cache ic-src="{{ img_url }}">
, I always got the XHR error like the following.