I am developing the project for hotel POS system. I am taking the orders from the customer. There are 2 types of orders present in the system as:
Take Away Orders.
Home delivery Orders.
In the orders table I am storing all the orders. I am fetching the takeaway orders in allCurrentTakeAwayOrder and home delivery orders in allcurrentHMOrder I want to show the takeaway orders and Home delivery orders in different sections.
I want to put condition if heading is Take Away then ng-repeat should take values from allCurrentTakeAwayOrder if its Home Delivery then from allcurrentHMOrder as:
<tr ng-repeat='orders in allCurrentTakeAwayOrder if heading=Take Away or
orders in allcurrentHMOrder if heading=Home Delivery' >
</tr>
If you really want to use a condition inside your ng-repeat, I would suggest using a ternary operator, like this:
<input type="checkbox" name="condition" ng-model="condition" />
<ul ng-init="numbers=[1,2,3];letters=['a','b','c'];">
<li ng-repeat="i in (condition ? numbers : letters)">
{{i}}
</li>
</ul>