My JSON object contains package ordering data. I am able to list all orders, parcels within each order, and SKUs in each parcel using a nested loop structure like the one below.
<div ng-repeat="order in orders">
order {{order.ordernum}}
<div ng-repeat="parcel in order.parcels">
{{parcel.upid}}
<div ng-repeat="sku in parcel.skus">
{{sku.sku}}{{sku.commodity}}
</div>
</div>
</div>
However, my requirement is to display details of a specific order only, not all orders. If it's the first order that I want to display, I can achieve this using:
<div ng-repeat="order in orders | limitTo: 1">
order {{order.ordernum}}
<div ng-repeat="parcel in order.parcels">
{{parcel.upid}}
<div ng-repeat="sku in parcel.skus">
{{sku.sku}}{{sku.commodity}}
</div>
</div>
</div>
The "limitTo:1" filter comes in handy for displaying the first order. But what if I need to display details based on a different index or an exact matching order number ("ordernum")?