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

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -