How to config $ocLazyLoadProvider.config.modules.name in this situation than serval modules in the same files.

Posted in General by lynn young Sun Feb 11 2018 10:15:57 GMT+0000 (UTC)·2·Viewed 256 times

How to config $ocLazyLoadProvider.config.modules.name in this situation than serval modules in the same files. For example,In Angular ui-grid. 'ui.grid', 'ui.grid.exporter', 'ui.grid.selection' those modules in the same file 'ui-grid.min.js'.I must config three modules have the same files but different names.Is there any way to config name like name:[ 'ui.grid', 'ui.grid.exporter', 'ui.grid.selection' ]?
lynn young
Feb 11, 2018

Sorry! The title should be:How to configure $ocLazyLoadProvider.config.modules.name in this situation that several modules in a same file.

lynn young
Feb 11, 2018

ok,I have add code in ocLazyload.js to solve this problem.We can configure name like name:['ui.grid','ui.grid.selection',.....].The code
// If we want to define modules configs
if(angular.isDefined(config.modules)) {
if(angular.isArray(config.modules)) {
angular.forEach(config.modules, function(moduleConfig) {
// 2018年2月11日18:30:21 to solve several modules in one same files.
console.log('moduleConfig ' + moduleConfig)
if(angular.isArray(moduleConfig.name)){
angular.forEach(moduleConfig.name, function(modulename){
modules[modulename] = moduleConfig;
})
}else{
modules[moduleConfig.name] = moduleConfig;
}
//
// modules[moduleConfig.name] = moduleConfig;
});
} else {
modules[config.modules.name] = config.modules;
}
}

  
Markdown is allowed