Something I can not understand what the problem is. There is such a simple piece of code:
return $q(function load(resolve, reject) { var source = nextSource(); var api = getById(source.resourceId); if (!loadedSources[index]) { api.promiseLoadContentPart(source).then(function(result) { if (result == 'error') { reject(false); } else if (result == 'loaded' || callbackStopLoading()) { loadedSources[index] = true; resolve(true); } else { load(); } }); } }); And it works as it should, until it comes to
resolve(true); Which falls with such an error:
angular.js: 13920 TypeError: resolve is not a function
Actually, what's the problem?
load();- called without parameters. therefore inside the call, resolve and reject will be undefined - Grundy