Skip to content

Commit dd24bcd

Browse files
committed
fix: staged lines missing from last commit
1 parent 633bec8 commit dd24bcd

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/ocLazyLoad.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(function() {
22
'use strict';
33
var regModules = ['ng'],
4-
initModules = [],
54
regInvokes = {},
65
regConfigs = [],
76
justLoaded = [],
87
runBlocks = {},
98
ocLazyLoad = angular.module('oc.lazyLoad', ['ng']),
10-
broadcast = angular.noop;
9+
broadcast = angular.noop,
10+
modulesToLoad = [];
1111

1212
ocLazyLoad.provider('$ocLazyLoad', ['$controllerProvider', '$provide', '$compileProvider', '$filterProvider', '$injector', '$animateProvider',
1313
function($controllerProvider, $provide, $compileProvider, $filterProvider, $injector, $animateProvider) {
@@ -904,7 +904,7 @@
904904
* @param element
905905
*/
906906
function init(element) {
907-
if(initModules.length === 0) {
907+
if(modulesToLoad.length === 0) {
908908
var elements = [element],
909909
names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
910910
NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/,
@@ -924,15 +924,15 @@
924924
});
925925

926926
angular.forEach(elements, function(elm) {
927-
if(initModules.length === 0) {
927+
if(modulesToLoad.length === 0) {
928928
var className = ' ' + element.className + ' ';
929929
var match = NG_APP_CLASS_REGEXP.exec(className);
930930
if(match) {
931-
initModules.push((match[2] || '').replace(/\s+/g, ','));
931+
modulesToLoad.push((match[2] || '').replace(/\s+/g, ','));
932932
} else {
933933
angular.forEach(elm.attributes, function(attr) {
934-
if(initModules.length === 0 && names[attr.name]) {
935-
initModules.push(attr.value);
934+
if(modulesToLoad.length === 0 && names[attr.name]) {
935+
modulesToLoad.push(attr.value);
936936
}
937937
});
938938
}
@@ -958,23 +958,23 @@
958958
}
959959
};
960960

961-
angular.forEach(initModules, function(moduleName) {
961+
angular.forEach(modulesToLoad, function(moduleName) {
962962
addReg(moduleName);
963963
});
964964

965-
initModules = []; // reset for next bootstrap
966965
angular.module = ngModuleFct; // restore angular.module
966+
modulesToLoad = []; // reset for next bootstrap
967967
}
968968

969969
var bootstrapFct = angular.bootstrap;
970970
angular.bootstrap = function(element, modules, config) {
971-
initModules = modules.slice(); // make a clean copy
971+
modulesToLoad = modules.slice(); // make a clean copy
972972
return bootstrapFct(element, modules, config);
973973
};
974974

975975
var addToInit = function addToInit(name) {
976-
if(angular.isString(name) && initModules.indexOf(name) === -1) {
977-
initModules.push(name);
976+
if(angular.isString(name) && modulesToLoad.indexOf(name) === -1) {
977+
modulesToLoad.push(name);
978978
}
979979
};
980980

0 commit comments

Comments
 (0)