Yes there is a perfect solution for this. Make the item page a child of your user page. When you fetch the user and items in the resolve of your state, it will be available also to all child states.
States:
$stateProvider.state('user', {
'url': '/user',
'controller': 'userController',
'templateUrl': 'user.html',
'resolve': {
'items': [
'$http',
function ($http) {
return $http.get('data.json');
}
]
}
});
$stateProvider.state('items', {
'parent': 'user',
'url': '/items',
'controller': 'itemsController',
'templateUrl': 'items.html'
});
Controllers:
angular.module('app').controller('userController', [
'$scope',
'items',
function ($scope, items) {
$scope.items = items.data;
}
]);
angular.module('app').controller('itemsController', [
'$scope',
'items',
function ($scope, items) {
$scope.items = items.data;
}
]);
Here the resolved items from state user can also be injected in the controller of state items.
Here's a working example on Plunker: http://plnkr.co/edit/s13BHHtVLt1sd6tFLfNW?p=preview
Nested state reference: https://github.com/angular-ui/ui-router/wiki/Nested-States-%26-Nested-Views
State resolve reference: https://github.com/angular-ui/ui-router/wiki#resolve