Attempting to bind data to a <select>
tag using AngularJS
.
Javascript Code
$scope.customerrouters = [];
$http.post("/Customer/GetCustomerRouterList").success(function (data) {
$scope.customerrouters = data;
});
$scope.selectedrouters = null;
HTML Code
<select class="form-control" ng-options="r as r.Name for r in customerrouters" ng-model="selectedrouters">
<option value="">-- Select --</option>
</select>
The issue is that the dropdown list appears differently than expected:
https://i.sstatic.net/kGCk3.png
Displayed HTML
https://i.sstatic.net/bGCbL.png
How can I fix the display of the elements?