-
Notifications
You must be signed in to change notification settings - Fork 619
Closed
Labels
Milestone
Description
Some libraries call $templateCache.get method as part of a check to see if the cache entry exists. If not, the 3rd party library will call $templateCache.set to add the entry. Thus, angular-templates templateCache.get delegate will always fail making it impossible to use 3rd party libraries using the mentioned pattern. As a result, can you please consider not throwing an error exception:
$delegate.get = function(templatePath) {
var originalResult = originalGet(templatePath);
if (angular.isUndefined(originalResult)) {
var fileExtension = ((templatePath.split('.') || []).pop() || '').toLowerCase();
// PLEASE DON"T CHECK OR FIGURE A WAY TO BE SMARTER
if (templatesFileExtension.indexOf(fileExtension) > -1) {
throw new Error('[angular-meteor][err][404] ' + templatePath + ' - HTML template does not exists!');
}
}
return originalResult;
};
Link to code:
https://github.com/Urigo/angular-meteor/blob/master/packages/angular-templates/templates-handler.js
Link to 3rd part library code:
https://github.com/JanStevens/angular-growl-2/blob/master/src/growlDirective.js
Thanks,
Bradley