changes like this:
if (angular.isObject(path)) {
file_type = path.type;
path = path.path;
}
cachePromise = filesCache.get(path);
if (angular.isUndefined(cachePromise) || params.cache === false) {
// always check for requirejs syntax just in case
if ((m = /^(css|less|html|htm|js)?(?=!)/.exec(path)) !== null) {
// Detect file type using preceding type declaration (ala requireJS)
file_type = m[1];
path = path.substr(m[1].length + 1, path.length); // Strip the type from the path
}
if (!file_type) {
if ((m = /[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(path)) !== null) {
// Detect file type via file extension
file_type = m[1];
} else if (!$delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader') && $delegate.jsLoader.hasOwnProperty('requirejs')) {
// requirejs
file_type = 'js';
} else {
$delegate._$log.error('File type could not be determined. ' + path);
return;
}
}
to:
if (angular.isObject(path)) {
file_type = path.type;
path = path.path;
}
// always check for requirejs syntax just in case
if ((m = /^(css|less|html|htm|js)?(?=!)/.exec(path)) !== null) {
// Detect file type using preceding type declaration (ala requireJS)
file_type = m[1];
path = path.substr(m[1].length + 1, path.length); // Strip the type from the path
}
cachePromise = filesCache.get(path);
if (angular.isUndefined(cachePromise) || params.cache === false) {
if (!file_type) {
if ((m = /[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(path)) !== null) {
// Detect file type via file extension
file_type = m[1];
} else if (!$delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader') && $delegate.jsLoader.hasOwnProperty('requirejs')) {
// requirejs
file_type = 'js';
} else {
$delegate._$log.error('File type could not be determined. ' + path);
return;
}
}
changes like this: if (angular.isObject(path)) { file_type = path.type; path = path.path; } cachePromise = filesCache.get(path); if (angular.isUndefined(cachePromise) || params.cache === false) {
to:
if (angular.isObject(path)) { file_type = path.type; path = path.path; } // always check for requirejs syntax just in case if ((m = /^(css|less|html|htm|js)?(?=!)/.exec(path)) !== null) { // Detect file type using preceding type declaration (ala requireJS) file_type = m[1]; path = path.substr(m[1].length + 1, path.length); // Strip the type from the path } cachePromise = filesCache.get(path); if (angular.isUndefined(cachePromise) || params.cache === false) {
will resove this problem