NgRepeat-With-Track-By

 
 
 
<!DOCTYPE html> <html lang="en-US"> <head> <title>Welcome in the Angular JS</title> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-rc.1/angular.min.js"></script> </head> <body ng-app="sampleApplication"> <div ng-controller="sampleController" > <div ng-repeat="emp in employees"> {{emp}} </div> <div ng-repeat="emp in employees track by $index"> {{emp}} </div> </div> <script> var app = angular.module("sampleApplication", []); app.controller("sampleController", function($scope) { $scope.employees = ["Ehrlich", "Epictetus", "Favre", "Ehrlich"]; }); </script> </body> </html>
Output