$ocLazyLoadProvider configuration section
{
name: 'ui.grid',
files: [
'vendor/modules/angular-ui-grid/ui-grid.min.css',
'vendor/modules/angular-ui-grid/ui-grid.min.js'
]
},
ui-router part
.state('app.account.account_M',{
url:'/account_M',
templateUrl:'tpl/account_account_M.html',
resolve: {
deps: ['$ocLazyLoad',
function( $ocLazyLoad ){
return $ocLazyLoad.load(['ui.grid']).then(
function(){
return $ocLazyLoad.load('js/controllers/account_M.js');
}
);
}]
}
})
This is no problem, but ui-grid separates many functions. If you want to use them, you need to inject multiple
s from ui-grid.min.js. As a result, I wrote it as follows
$ ocLazyLoadProvider configuration section
{
name: 'ui.grid',
files: [
'vendor/modules/angular-ui-grid/ui-grid.min.css',
'vendor/modules/angular-ui-grid/ui-grid.min.js'
]
},
{
name: 'ui.grid.resizeColumns',
files: [
'vendor/modules/angular-ui-grid/ui-grid.min.css',
'vendor/modules/angular-ui-grid/ui-grid.min.js'
]
},
{
name: 'ui.grid.expandable',
files: [
'vendor/modules/angular-ui-grid/ui-grid.min.css',
'vendor/modules/angular-ui-grid/ui-grid.min.js'
]
},
ui-router part
.state('app.account.account_M',{
url:'/account_M',
templateUrl:'tpl/account_account_M.html',
resolve: {
deps: ['$ocLazyLoad',
function( $ocLazyLoad ){
return $ocLazyLoad.load(['ui.grid','ui.grid.resizeColumns','ui.grid.expandable']).then(
function(){
return $ocLazyLoad.load('js/controllers/account_M.js');
}
);
}]
}
})
But it definitely can’t be like this. This should load ui-grid.min.js and css multiple times. What should I do? Please give me some advice
Issues I saw before