My current situation involves these columns:
Column
1
1
2
What I am aiming for in the output is to avoid the repetition of the '1' values when using ng-repeat. This can be illustrated as follows:
Column
1
2
Is there a method to detect and exclude repeated values during the iteration process of ng-repeat?
Below is my existing code snippet along with a working fiddle:
<div ng-app="myApp" ng-controller="myCtrl">
<table>
<tbody>
<tr ng-repeat="item in obj">
<td> {{ item.col1 }} </td>
</tr>
</tbody>
</table>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
$scope.obj = [{ col1: 1}, { col1: 1}, { col1: 2}];
});
</script>
EDIT: I am interested in exploring alternative solutions to address this issue without solely relying on a filter, as most responses in similar queries suggest using a filter.