angularjs - Angular nested and filtered ng-repeat totals -
i have list of customers , orders every customer. looks this:
<ul> <li ng-repeat="customer in data.customes" | filter:customerfilterfn "> {{customer.name}} {{??? total should change depending on nested filtered data???}} <ul> <li ng-repeat="order in customer.orders" | filter:orderfilterfn "> {{order.id}} {{order.sum}} </li> </ul> </li> </ul> as see, both lists filtered own functions (for orders date range).
what best approach customer's total filtered set of orders?
you use $index ng-repeat directive. way each order's value, , can maintain $scope variable customer's total.
Comments
Post a Comment