Currently, I am working on a restful service that retrieves an order along with a list of items. In my project, I am developing a screen where users can edit specific items within the order. To achieve this, I need to display the list of items before locating and displaying information about the selected item. My approach includes:
$scope.order = orderResource.get({id:$routeParams.orderId}, function(order) {
$scope.item = _.findWhere(order.items, {id:$routeParams.itemId});
});
The binding for this implementation is as follows:
<input id="itemName" type="text" ng-model="item.name">
My main concern at this point is whether this method is the most optimal way to address the challenge at hand. (Please note that I prefer not to use a route with a resolve.)