Reputation:
i'm trying achieve something like this :
$stateProvider.state('app', {
url: "/app",
templateUrl: "assets/views/app.html",
resolve: {
authorize: ['authorization',
function(authorization) {
return authorization.authorize();
}
],
loadSequence: loadSequence('chartjs', 'chart.js', 'chatCtrl')
},
abstract: true
resolving "authorize" then "LoadSequence" function, but the error i get is confusing and i can't figure out how to do it properly :
Error: ng:areq Bad Argument Argument 'fn' is not a function, got Object
Best regards.
Upvotes: 3
Views: 291
Reputation: 6620
I think you need to wrap the second item in resolve
in a function like you did the first one:
$stateProvider.state('app', {
url: "/app",
templateUrl: "assets/views/app.html",
resolve: {
authorize: ['authorization',
function(authorization) {
return authorization.authorize();
}
],
loadSequence: function(){
return loadSequence('chartjs', 'chart.js', 'chatCtrl');
}
},
abstract: true
Also, if loadSequence
does not return a promise, it needs to.
Upvotes: 1