In this example, we have an array of students with id and name of the student. We print the name of the student using ng-repeat directive and we track this array by student id. if there are two or more students with the same id then this ng-repeat directive will display nothing. Let's see the example:

<!DOCTYPE html> <html xmlns=""> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src=""></script> </head> <body ng-app="app"> <div ng-controller="controllerName"> <div ng-repeat="student in students track by"> {{}} </div> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.students = [{ id: '1', name: 'Smith' }, { id: '2', name: 'Allen' }, { id: '3', name: 'David' }, { id: '4', name: 'John' }, { id: '5', name: 'John' }, { id: '6', name: 'John' }]; }]); </script> </body> </html>