I have the following array:
vm.persons = [{id:1, name:'Manuel1', age:30}, {id:2, name:'Manuel2', errorCode:'Error', age:18}]
And I want to show in this way:
------------------
|Name | Age |
------------------
|Manuel2 | Error |
------------------
|Manuel1 | 30 |
------------------
So, if errorCode
is present, the age should not be shown.
This is what I have right now:
<tr ng-repeat="person in persons" ng-class="...">
<td>{{::person.name}}</td>
<td>{{::person.age}}</td>
</tr>
How can I do that check. I'd like to show in first place the persons with error and then the rest. I think that you can do that with array.sort, right?