afridi shayed afridi shayed - 2 months ago 8
AngularJS Question

Dropdown list values not being populated

My aim is to show values in a dropdown list.

My code gets the data from database but the dropdown list is not being populated

$scope.CountryID = xxx.CountryID;

Answer

To show data in DropDown list you need use ng-repeat

eg:-

<select>
    <option ng-repeat="cate in category" value="{{cate.id}}">{{cate.name}}<option>
</select>

In above code category is a $scope with data from DB