code: function add(src) {
        var defer = $q.defer();
  
        _checkImgCacheReady()
          .then(function() {
            ImgCache.cacheFile(src, function() {
              ImgCache.isCached(src, function(path, success) {
                defer.resolve(path);
              }, defer.reject);
            }, defer.reject);
          })
          .catch(defer.reject);
  
        return defer.promise;
      }
docs: /* ngInject 
  Adds file to local cache.
  @param {string} src - image source url.