Our Angular project involves working with an array named data that contains:
$scope.data= [
{_id: '1', rev: 1-bar},
{_id: '2', rev: 2-bar},
{_id: '3', rev: 3-bar},
{_id: '4', rev: 4-bar},
{_id: '5', rev: 1-bar},
{_id: '5', rev: 2-bar},
{_id: '5', rev: 3-bar}
];
In the HTML code, we have:
<div ng-repeat="items in data | unique: '_id'">
{{items._id}}
</div>
We are currently using an Angular filter called unique to display only one item for each unique _id. However, the filter does not account for revisions. As a result, changes made do not reflect until the page is reloaded. We need a solution to showcase only the _id with the highest revision.
Your assistance on this matter would be greatly appreciated!