Skip to content

Commit

Permalink
chore: bump to 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Mar 9, 2015
1 parent cf99e40 commit 6580700
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<a name="0.6.3"></a>
# 0.6.3 (2015-03-09)


## Bug Fixes

- detect file type when path contains url parameters
([57e1801d](https://github.com/ocombe/ocLazyLoad/commit/57e1801d933f978060954bd8707f586b51544906),
[#137](https://github.com/ocombe/ocLazyLoad/issues/137))
- rejected promise should be returned immediately
([887a67c4](https://github.com/ocombe/ocLazyLoad/commit/887a67c4196fa4bbd65c34f6eba1d8b2bca9fed3))


<a name="0.6.2"></a>
# 0.6.2 (2015-03-05)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oclazyload",
"version": "0.6.2",
"version": "0.6.3",
"description": "Load modules on demand (lazy load) with angularJS",
"main": "dist/ocLazyLoad.min.js",
"homepage": "https://github.com/ocombe/ocLazyLoad",
Expand Down
14 changes: 8 additions & 6 deletions dist/ocLazyLoad.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* oclazyload - Load modules on demand (lazy load) with angularJS
* @version v0.6.2
* @version v0.6.3
* @link https://github.com/ocombe/ocLazyLoad
* @license MIT
* @author Olivier Combe <[email protected]>
Expand Down Expand Up @@ -67,6 +67,7 @@
* Load a js/css file
* @param type
* @param path
* @param params
* @returns promise
*/
var buildElement = function buildElement(type, path, params) {
Expand Down Expand Up @@ -114,7 +115,7 @@
broadcast('ocLazyLoad.fileLoaded', path);
deferred.resolve();
};
el.onerror = function(e) {
el.onerror = function() {
deferred.reject(new Error('Unable to load ' + path));
};
el.async = params.serie ? 0 : 1;
Expand Down Expand Up @@ -283,7 +284,7 @@
}

if (!file_type) {
if ((m = /[.](css|less|html|htm|js)?$/.exec(path)) !== null) { // Detect file type via file extension
if ((m = /[.](css|less|html|htm|js)?(\?.*)?$/.exec(path)) !== null) { // Detect file type via file extension
file_type = m[1];
} else if(!jsLoader.hasOwnProperty('ocLazyLoadLoader') && jsLoader.hasOwnProperty('load')) { // requirejs
file_type = 'js';
Expand All @@ -302,6 +303,7 @@
} else {
$log.error('File type is not valid. ' + path);
}

} else if(cachePromise) {
promises.push(cachePromise);
}
Expand Down Expand Up @@ -492,6 +494,7 @@
errText = 'Module "' + (moduleName || 'unknown') + '" is not configured, cannot load.';
$log.error(errText);
deferred.reject(new Error(errText));
return deferred.promise;
} else {
// deprecated
if(angular.isDefined(config.template)) {
Expand Down Expand Up @@ -605,7 +608,6 @@
if(modulesToLoad.length === 0) {
deferred.resolve(module);
} else {
var resolvedModules = [];
var loadNext = function loadNext(moduleName) {
moduleCache.push(moduleName);
loadDependencies(moduleName).then(function success() {
Expand Down Expand Up @@ -853,7 +855,8 @@
/**
* Register an invoke
* @param args
* @returns {*}
* @param moduleName
* @returns {boolean}
*/
function registerInvokeList(args, moduleName) {
var invokeList = args[2][0],
Expand Down Expand Up @@ -1029,7 +1032,6 @@
}
return value;
});
cache = null; // Enable garbage collection
};

// Array.indexOf polyfill for IE8
Expand Down
4 changes: 2 additions & 2 deletions dist/ocLazyLoad.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oclazyload",
"version": "0.6.2",
"version": "0.6.3",
"description": "Load modules on demand (lazy load) with angularJS",
"main": "dist/ocLazyLoad.min.js",
"author": "Olivier Combe <[email protected]>",
Expand Down

0 comments on commit 6580700

Please sign in to comment.