Articles → ANGULAR.JS → Bind data in table in angular.js

Bind data in table in angular.js







<script type = "text/javascript">
 var app = angular.module('app', []);
app.controller('myController', function($scope) {
 $scope.Voters = [{
   Name: "Karan",
   Age: 33
  },
  {
   Name: "Anurag",
   Age: 26
  },
  {
   Name: "Ritesh",
   Age: 34
  }
 ];
}); 
</script>




<div ng-app="app" ng-controller="myController">
	<table>
		<tr ng-repeat="voter in Voters">
			<td> {{voter.Name}} </td>
			<td> {{voter.Age}} </td>
		</tr>
	</table>
</div>



Output



Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, July 27, 2015

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250