I have the following controller:
<div ng-app="" ng-controller="studentController">
<table>
<tr>
<th>Name</th>
<th>Marks</th>
</tr>
<tr ng-repeat="subject in student.subjects">
<td> {{ subject.name }} </td>
<td> {{ subject.marks }} </td>
</tr>
</table>
</div>
I have the following script:
function studentController($scope) {
$scope.student = {
subjects:[
{name:'Physics',marks:70},
{name:'Chemistry',marks:80},
{name:'Math',marks:65},
{name:'English',marks:75},
{name:'Hindi',marks:67}
]
};
}
In the console the error says that the studentController
is not a function. So it could be from the JS but I dont notice anything, ideas?