Кусок с Factory
order.getOrder = function(id) {
var deferred = $q.defer();
$http.get('/order-info/id' + id).success(function(order) {
deferred.resolve(order);
}).error(function(data, status, headers, config) {
deferred.reject(status);
});
console.log(deferred.promise);
return deferred.promise;
};
Вот и сам роутинг :
.state('order', {
url: "/order/id{id}",
views: {
'content': {
templateUrl: "/modules/order/order_details.html",
controller: "orderCtrl",
resolve: {
orderService: 'orderService',
order: ['$stateParams', 'orderService', function($stateParams, orderService) {
var orderId = $stateParams.id;
return orderService.getOrder(orderId);
}]
}
},
}
})
В чем может быть пробелма?