-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* oclazyload - Load modules on demand (lazy load) with angularJS | ||
* @version v1.0.6 | ||
* @version v1.0.7 | ||
* @link https://github.com/ocombe/ocLazyLoad | ||
* @license MIT | ||
* @author Olivier Combe <[email protected]> | ||
|
@@ -629,7 +629,7 @@ | |
if (angular.isArray(moduleName)) { | ||
var promisesList = []; | ||
angular.forEach(moduleName, function (module) { | ||
promisesList.push(self.inject(moduleName, localParams, real)); | ||
promisesList.push(self.inject(module, localParams, real)); | ||
}); | ||
return $q.all(promisesList); | ||
} else { | ||
|
@@ -963,7 +963,7 @@ | |
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('load')) { | ||
} else if (!$delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader') && $delegate.jsLoader.hasOwnProperty('requirejs')) { | ||
// requirejs | ||
file_type = 'js'; | ||
} else { | ||
|
@@ -1023,7 +1023,7 @@ | |
if (jsFiles.length > 0) { | ||
var jsDeferred = $q.defer(); | ||
$delegate.jsLoader(jsFiles, function (err) { | ||
if (angular.isDefined(err) && $delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader')) { | ||
if (angular.isDefined(err) && ($delegate.jsLoader.hasOwnProperty("ocLazyLoadLoader") || $delegate.jsLoader.hasOwnProperty("requirejs"))) { | ||
$delegate._$log.error(err); | ||
jsDeferred.reject(err); | ||
} else { | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* oclazyload - Load modules on demand (lazy load) with angularJS | ||
* @version v1.0.6 | ||
* @version v1.0.7 | ||
* @link https://github.com/ocombe/ocLazyLoad | ||
* @license MIT | ||
* @author Olivier Combe <[email protected]> | ||
|
@@ -629,7 +629,7 @@ | |
if (angular.isArray(moduleName)) { | ||
var promisesList = []; | ||
angular.forEach(moduleName, function (module) { | ||
promisesList.push(self.inject(moduleName, localParams, real)); | ||
promisesList.push(self.inject(module, localParams, real)); | ||
}); | ||
return $q.all(promisesList); | ||
} else { | ||
|
@@ -963,7 +963,7 @@ | |
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('load')) { | ||
} else if (!$delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader') && $delegate.jsLoader.hasOwnProperty('requirejs')) { | ||
// requirejs | ||
file_type = 'js'; | ||
} else { | ||
|
@@ -1023,7 +1023,7 @@ | |
if (jsFiles.length > 0) { | ||
var jsDeferred = $q.defer(); | ||
$delegate.jsLoader(jsFiles, function (err) { | ||
if (angular.isDefined(err) && $delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader')) { | ||
if (angular.isDefined(err) && ($delegate.jsLoader.hasOwnProperty("ocLazyLoadLoader") || $delegate.jsLoader.hasOwnProperty("requirejs"))) { | ||
$delegate._$log.error(err); | ||
jsDeferred.reject(err); | ||
} else { | ||
|
@@ -1194,7 +1194,10 @@ | |
* @param params object config parameters | ||
* because the user can overwrite jsLoader and it will probably not use promises :( | ||
*/ | ||
$delegate.jsLoader = require; | ||
$delegate.jsLoader = function (paths, callback, params) { | ||
require(paths, callback, callback, params); | ||
}; | ||
$delegate.jsLoader.requirejs = true; | ||
|
||
return $delegate; | ||
}]); | ||
|
Oops, something went wrong.