Skip to content

Commit c282f8f

Browse files
committed
chore: bump to 1.1.0
1 parent 17d372f commit c282f8f

11 files changed

+264
-197
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
<a name="1.0.10"></a>
2+
# 1.1.0 (2017-02-03)
3+
4+
5+
## Bug Fixes
6+
7+
- resolve the loader with created elements
8+
([3351e44d](https://github.com/ocombe/ocLazyLoad/commit/3351e44d2d76b7599eadfe59dec5a5674b1aff69), [#292](https://github.com/ocombe/ocLazyLoad/pull/292))
9+
- ensure CSS loader uses loading patch for PhantomJS 1.9 ([54d68e92](https://github.com/ocombe/ocLazyLoad/commit/54d68e92f83b1c9f5eba805a764c147566843544), [#280](https://github.com/ocombe/ocLazyLoad/pull/280))
10+
11+
12+
## Features
13+
14+
- angular 1.6 compatibility
15+
([17d372fc](https://github.com/ocombe/ocLazyLoad/commit/17d372fce194a840a0d23f7a8b417601f769f52a),
16+
[#377](https://github.com/ocombe/ocLazyLoad/issues/377))
17+
- allow hot reloading via systemjs-hot-reloader ([94088482](https://github.com/ocombe/ocLazyLoad/commit/94088482aad2bba0f49c3d873886e993bcdfa13c), [#291](https://github.com/ocombe/ocLazyLoad/pull/291))
18+
19+
120
<a name="1.0.9"></a>
221
# 1.0.9 (2015-11-24)
322

bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oclazyload",
3-
"version": "1.0.9",
3+
"version": "1.1.0",
44
"description": "Load modules on demand (lazy load) with angularJS",
55
"main": "dist/ocLazyLoad.js",
66
"homepage": "https://github.com/ocombe/ocLazyLoad",
@@ -36,4 +36,4 @@
3636
"dependencies": {
3737
"angular": ">=1.2.0"
3838
}
39-
}
39+
}

dist/modules/ocLazyLoad.core.js

+10
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,16 @@
736736

737737
var bootstrapFct = angular.bootstrap;
738738
angular.bootstrap = function (element, modules, config) {
739+
// Clean state from previous bootstrap
740+
regModules = ['ng', 'oc.lazyLoad'];
741+
regInvokes = {};
742+
regConfigs = [];
743+
modulesToLoad = [];
744+
realModules = [];
745+
recordDeclarations = [];
746+
broadcast = angular.noop;
747+
runBlocks = {};
748+
justLoaded = [];
739749
// we use slice to make a clean copy
740750
angular.forEach(modules.slice(), function (module) {
741751
_addToLoadList(module, true, true);

dist/modules/ocLazyLoad.loaders.common.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979

8080
/*
8181
The event load or readystatechange doesn't fire in:
82+
- PhantomJS 1.9 (headless webkit browser)
8283
- iOS < 6 (default mobile browser)
8384
- Android < 4.4 (default mobile browser)
8485
- Safari < 6 (desktop browser)
@@ -87,16 +88,20 @@
8788
if (!uaCssChecked) {
8889
var ua = $window.navigator.userAgent.toLowerCase();
8990

90-
// iOS < 6
91-
if (/iP(hone|od|ad)/.test($window.navigator.platform)) {
91+
if (ua.indexOf('phantomjs/1.9') > -1) {
92+
// PhantomJS ~1.9
93+
useCssLoadPatch = true;
94+
} else if (/iP(hone|od|ad)/.test($window.navigator.platform)) {
95+
// iOS < 6
9296
var v = $window.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);
9397
var iOSVersion = parseFloat([parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)].join('.'));
9498
useCssLoadPatch = iOSVersion < 6;
95-
} else if (ua.indexOf("android") > -1) {
99+
} else if (ua.indexOf('android') > -1) {
96100
// Android < 4.4
97-
var androidVersion = parseFloat(ua.slice(ua.indexOf("android") + 8));
101+
var androidVersion = parseFloat(ua.slice(ua.indexOf('android') + 8));
98102
useCssLoadPatch = androidVersion < 4.4;
99103
} else if (ua.indexOf('safari') > -1) {
104+
// Safari < 6
100105
var versionMatch = ua.match(/version\/([\.\d]+)/i);
101106
useCssLoadPatch = versionMatch && versionMatch[1] && parseFloat(versionMatch[1]) < 6;
102107
}

dist/modules/ocLazyLoad.loaders.templatesLoader.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
angular.forEach(paths, function (url) {
1919
var deferred = $q.defer();
2020
promises.push(deferred.promise);
21-
$http.get(url, params).success(function (data) {
21+
$http.get(url, params).then(function (response) {
22+
var data = response.data;
2223
if (angular.isString(data) && data.length > 0) {
2324
angular.forEach(angular.element(data), function (node) {
2425
if (node.nodeName === 'SCRIPT' && node.type === 'text/ng-template') {
@@ -30,8 +31,8 @@
3031
filesCache.put(url, true);
3132
}
3233
deferred.resolve();
33-
}).error(function (err) {
34-
deferred.reject(new Error('Unable to load template file "' + url + '": ' + err));
34+
})['catch'](function (response) {
35+
deferred.reject(new Error('Unable to load template file "' + url + '": ' + response.data));
3536
});
3637
});
3738
return $q.all(promises).then(function () {
+60-60
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
// Array.indexOf polyfill for IE8
22
if (!Array.prototype.indexOf) {
3-
Array.prototype.indexOf = function (searchElement, fromIndex) {
4-
var k;
5-
6-
// 1. Let O be the result of calling ToObject passing
7-
// the this value as the argument.
8-
if (this == null) {
9-
throw new TypeError('"this" is null or not defined');
10-
}
11-
12-
var O = Object(this);
13-
14-
// 2. Let lenValue be the result of calling the Get
15-
// internal method of O with the argument "length".
16-
// 3. Let len be ToUint32(lenValue).
17-
var len = O.length >>> 0;
18-
19-
// 4. If len is 0, return -1.
20-
if (len === 0) {
21-
return -1;
22-
}
23-
24-
// 5. If argument fromIndex was passed let n be
25-
// ToInteger(fromIndex); else let n be 0.
26-
var n = +fromIndex || 0;
27-
28-
if (Math.abs(n) === Infinity) {
29-
n = 0;
30-
}
31-
32-
// 6. If n >= len, return -1.
33-
if (n >= len) {
34-
return -1;
35-
}
36-
37-
// 7. If n >= 0, then Let k be n.
38-
// 8. Else, n<0, Let k be len - abs(n).
39-
// If k is less than 0, then let k be 0.
40-
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
41-
42-
// 9. Repeat, while k < len
43-
while (k < len) {
44-
// a. Let Pk be ToString(k).
45-
// This is implicit for LHS operands of the in operator
46-
// b. Let kPresent be the result of calling the
47-
// HasProperty internal method of O with argument Pk.
48-
// This step can be combined with c
49-
// c. If kPresent is true, then
50-
// i. Let elementK be the result of calling the Get
51-
// internal method of O with the argument ToString(k).
52-
// ii. Let same be the result of applying the
53-
// Strict Equality Comparison Algorithm to
54-
// searchElement and elementK.
55-
// iii. If same is true, return k.
56-
if (k in O && O[k] === searchElement) {
57-
return k;
58-
}
59-
k++;
60-
}
61-
return -1;
62-
};
3+
Array.prototype.indexOf = function (searchElement, fromIndex) {
4+
var k;
5+
6+
// 1. Let O be the result of calling ToObject passing
7+
// the this value as the argument.
8+
if (this == null) {
9+
throw new TypeError('"this" is null or not defined');
10+
}
11+
12+
var O = Object(this);
13+
14+
// 2. Let lenValue be the result of calling the Get
15+
// internal method of O with the argument "length".
16+
// 3. Let len be ToUint32(lenValue).
17+
var len = O.length >>> 0;
18+
19+
// 4. If len is 0, return -1.
20+
if (len === 0) {
21+
return -1;
22+
}
23+
24+
// 5. If argument fromIndex was passed let n be
25+
// ToInteger(fromIndex); else let n be 0.
26+
var n = +fromIndex || 0;
27+
28+
if (Math.abs(n) === Infinity) {
29+
n = 0;
30+
}
31+
32+
// 6. If n >= len, return -1.
33+
if (n >= len) {
34+
return -1;
35+
}
36+
37+
// 7. If n >= 0, then Let k be n.
38+
// 8. Else, n<0, Let k be len - abs(n).
39+
// If k is less than 0, then let k be 0.
40+
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
41+
42+
// 9. Repeat, while k < len
43+
while (k < len) {
44+
// a. Let Pk be ToString(k).
45+
// This is implicit for LHS operands of the in operator
46+
// b. Let kPresent be the result of calling the
47+
// HasProperty internal method of O with argument Pk.
48+
// This step can be combined with c
49+
// c. If kPresent is true, then
50+
// i. Let elementK be the result of calling the Get
51+
// internal method of O with the argument ToString(k).
52+
// ii. Let same be the result of applying the
53+
// Strict Equality Comparison Algorithm to
54+
// searchElement and elementK.
55+
// iii. If same is true, return k.
56+
if (k in O && O[k] === searchElement) {
57+
return k;
58+
}
59+
k++;
60+
}
61+
return -1;
62+
};
6363
}

0 commit comments

Comments
 (0)