My AngularJS app is supposed to show courses and their equivalences in a table. The table is supposed to dynamically show the results based on the input from a select element.
HTML
<form name = "Select University" ng-show = "courseType == 'extern'">
<label for = "University"> University: </label>
<select name = "University" id = "repeatSelect" ng-change = "changeIt()"ng-model = "univs.repeatSelect">
<option ng-repeat = "univ in univs.uniNames | orderBy: 'School'" > {{univ.School}} </option>
</select>
</form>
Courses at {{univs.repeatSelect}}
<table>
<tr>
<th> Course </th>
<th> Equivelance </th>
</tr>
<tr ng-repeat="x in names | orderBy: 'className' | filter:univs.repeatSelect">
<td>{{ x.className }}</td>
<td> {{x.equiv}} </td>
</tr>
</table>
JavaScript
$http.get("http://linux.students.engr.scu.edu/~cmulloy/COEN174/getSchools.php")
.success(function (response)
{
$scope.univs.uniNames = response.records;
});
$scope.univs =
{
repeatSelect: null,
uniNames: null,
};
The scope variable {{univs.repeatSelect}} shows up on the page. For example, it will show "Courses at UCLA" above the table. But the table is empty when I use univs.repeatSelect as the filter argument for ng-repeat. However, if I explicitly use 'UCLA' as the filter argument, it works and shows the courses at UCLA. Is there something I'm missing?