The ng-repeat Directive (with Objects)




The ng-repeat Directive (with Objects)

<!DOCTYPE html>
<html>
   <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">
   </script>
   <body>
      <div ng-app="" ng-init="names=[
         {name:'SRK',country:'Norway'},
         {name:'Ali',country:'Sweden'},
         {name:'Annu',country:'Denmark'}]">
         <p>Looping with objects:</p>
         <ul>
            <li ng-repeat="x in names">
            {{ x.name + ', ' + x.country }}</li>
         </ul>
      </div>
   </body>
</html>

Output