I have these column:
Column
1
1
2
What I want in the result is that the duplicated '1' will not be repeated in the ng-repeat. Here's the illustration:
Column
1
2
Is there a way to check that if a value is repeated it will not be included in the iteration of the ng-repeat?
Here's my working fiddle so far:
<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 just want to know if is there any other way aside from using a filter? Since in the duplicate question, all the answers discussed about using filter.