code: function _checkImgCacheReady() {
        var defer = $q.defer();
  
        if (ImgCache.ready) {
          defer.resolve();
        }
        else{
          document.addEventListener('ImgCacheReady', function() { // eslint-disable-line
            defer.resolve();
          }, false);
        }
  
        return defer.promise;
      }
docs: Checks if imgcache library initialized.
  @private