is it possible to have a condition in a ng-repeat section ? I want the list to be reversed if the condition is true
<td ng-repeat="dataset in something.datasets if(true) { reverse }">
is it possible to have a condition in a ng-repeat section ? I want the list to be reversed if the condition is true
<td ng-repeat="dataset in something.datasets if(true) { reverse }">
You don't need a condition, you can use a filter for this which is orderBy
<ul>
<li ng-repeat='item in vm.items | orderBy: item : vm.reverse'>
{{item}}
</li>
</ul>
if vm.reverse
is true, it will display in the reverse order.
Documentation for orderBy