<link href="~/Content/bootstrap.css" rel="stylesheet" />
Output:
<script src="~/Scripts/angular.js"></script>
<h2>Employee Details</h2>
<br />
<script type="text/javascript">
angular.module('myApp', [])
.controller('MyController', [function () {
var emp = this;
emp.employees = [
{ id: 1, empName: 'Mithilesh', address: 'Hyderabad',phoneNo:'1232345476' },
{ id: 2, empName: 'Sanjeev', address: 'Delhi', phoneNo: '1229645476' },
{ id: 3, empName: 'Sonu ', address: 'Mumbai', phoneNo: '1232389276' },
{ id: 4, empName: 'Firoz', address: 'Banglore', phoneNo: '1232345476' }
];
}]);
</script>
<body class="row" ng-app="myApp" ng-controller="MyController as ctrl">
<div class="col-md-7">
<table class="table">
<tr class="btn-primary">
<th>Employee Id</th>
<th>Employee Name</th>
<th>Address</th>
<th>Phone Number</th>
</tr>
<tr class="btn-info" ng-repeat="details in ctrl.employees">
<td>{{details.id}}</td>
<td>{{details.empName}}</td>
<td>{{details.address}}</td>
<td>{{details.phoneNo}}</td>
</tr>
</table>
</div>
</body>
Output:
No comments:
Post a Comment