After purchasing an angularjs template for my application, I noticed that ngRouter was used instead of ui-router, which I am more comfortable with. So, I decided to switch to ui-router and update all the routes. However, I encountered some extra code in my routes that I don't fully understand where to place. Here is the old route for my dashboard:
$routeProvider.when("/dashboard", {
templateUrl: "views/dashboard.html",
resolve: {
deps: ["$ocLazyLoad", function(a) {
return a.load([jqload.c3, jqload.sparkline])
.then(function() {
return a.load({
name: "app.directives",
files: ["scripts/lazyload/directives/sparkline.directive.js"]
})
})
.then(function() {
return a.load("angular-c3");
})
.then(function() {
return a.load("easypiechart");
})
}]
}
});
Here is the updated version using ui-router:
.state('admin.dashboard', {
url: '/dashboard',
views: {
'content@': {
templateUrl: '/_admin/views/dashboard.html',
controller: 'DashboardCtrl'
}
}
However, there seems to be missing code affecting certain functionality of my dashboard. My question is, when using ui-router, where should I include the code in resolve:
resolve: {
deps: ["$ocLazyLoad", function(a) {
return a.load([jqload.c3, jqload.sparkline])
.then(function() {
return a.load({
name: "app.directives",
files: ["scripts/lazyload/directives/sparkline.directive.js"]
})
})
.then(function() {
return a.load("angular-c3");
})
.then(function() {
return a.load("easypiechart");
})
}]
}
This section on resolve is new to me as I'm still learning angularjs. Any advice on how to deal with this after transitioning to ui-router would be appreciated.