11
11
DOCTYPE html>
<html ng-app="myApp">
<head>
<title>Student Details</title>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></
script>
</head>
<body>
<div ng-controller="StudentController as ctrl">
<h2>Student Details</h2>
<table border="1">
<tr>
<th>Name</th>
<th>CGPA</th>
</tr>
<tr ng-repeat="student in ctrl.students">
<td>{{ student.name | uppercase }}</td>
<td>{{ student.cgpa | number:2 }}</td>
</tr>
</table>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('StudentController', function () {
this.students = [
{ name: "Sharanya", cgpa: 3.8 },
{ name: "Virat", cgpa: 3.6 },
{ name: "Rohit", cgpa: 3.5 },
{ name: "Taylor", cgpa: 3.7 }
];
});
</script>
</body>
</html>