diff --git a/angular-imgcache.js b/angular-imgcache.js index 68172d4..81d0b41 100644 --- a/angular-imgcache.js +++ b/angular-imgcache.js @@ -68,6 +68,16 @@ angular.module('ImgCache', []) } else { ImgCache.cacheFile(src, function() { setImg(type, el, src); + },function() { + // fallback to original source if e.g. src is a relative file and therefore loaded from file system + if(src) + { + if(type === 'bg') { + el.css({'background-image': 'url(' + src + ')' }); + } else { + el.attr('src', src); + } + } }); }