Fixed loading templates from DOM

This commit is contained in:
Marcin Kurczewski
2014-10-04 22:46:28 +02:00
parent 63878b27a1
commit 33c1d99583
3 changed files with 5 additions and 3 deletions

View File

@ -18,13 +18,14 @@ App.Promise = function(_, jQuery) {
active = _.without(active, promise.promiseId);
});
active.push(promise.promiseId);
promise.then(function() {
if (!_.contains(active, promise.promiseId)) {
throw new Error('Broken promise');
throw new Error('Broken promise (promise ID: ' + promise.promiseId + ')');
}
});
active.push(promise.promiseId);
return promise;
}

View File

@ -62,6 +62,7 @@ App.Util = function(_, jQuery, promise) {
resolve(templateCache[templateName]);
});
}
return null;
}
function promiseTemplateFromDOM(templateName) {