diff --git a/dist/modules/ocLazyLoad.core.js b/dist/modules/ocLazyLoad.core.js index 2726463..ef6df1e 100644 --- a/dist/modules/ocLazyLoad.core.js +++ b/dist/modules/ocLazyLoad.core.js @@ -28,7 +28,8 @@ debug = false, events = false, moduleCache = [], - modulePromises = {}; + modulePromises = {}, + defaultScriptType = 'application/javascript'; moduleCache.push = function (value) { if (this.indexOf(value) === -1) { @@ -55,6 +56,10 @@ if (angular.isDefined(config.events)) { events = config.events; } + + if (angular.isDefined(config.defaultScriptType)) { + defaultScriptType = config.defaultScriptType; + } }; /** @@ -441,6 +446,14 @@ return regModules; }, + /** + * Returns the default value to use for script type attribute + * @returns {string} + */ + getDefaultScriptType: function getModules() { + return defaultScriptType; + }, + /** * Let you check if a module has been loaded into Angular or not * @param modulesNames String/Object a module name, or a list of module names @@ -762,4 +775,4 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.exports === exports) { module.exports = 'oc.lazyLoad'; } -})(angular, window); \ No newline at end of file +})(angular, window); diff --git a/dist/modules/ocLazyLoad.loaders.common.js b/dist/modules/ocLazyLoad.loaders.common.js index d7fcfcc..9803604 100644 --- a/dist/modules/ocLazyLoad.loaders.common.js +++ b/dist/modules/ocLazyLoad.loaders.common.js @@ -48,6 +48,7 @@ break; case 'js': el = $window.document.createElement('script'); + el.type = angular.isDefined(params.scriptType) ? params.scriptType : this.getDefaultScriptType(); el.src = params.cache === false ? cacheBuster(path) : path; break; default: @@ -124,4 +125,4 @@ return $delegate; }]); }]); -})(angular); \ No newline at end of file +})(angular);