I am trying to set up a resolve on a view to get some user information before the view gets rendered, because the data from the API will determine what view they user will see. I tried putting my service into the resolve, but $stateParams
are not set when inside the service for some reason:
.state('order.sharepoint', {
url: '/sharepoint',
abstract: true,
controller: 'SharePointController',
resolve: {
OrderResolve: function(Order, $stateParams){ // Here $stateParams
return Order.fetch(); // is set correctly!
}
}
});
Order Service
app.factory('Order', function ($q, API, $stateParams) { // HERE $stateParams
// is empty for some reason
var Order = null;
var service = {};
service.fetch = function () {
/// Here is my API call and everything
}