Reputation: 219
Hi I am new in angularjs with asp.net mvc,i am facing drop down selection,when i try to selected the drop down its not working.
Html
<select class="form-control" required="" name="ProfileID" ng-model="ProfileID">
<option value="">--- Select an option ---</option>
<option ng-selected= "{{st.ProfileID == ProfileID}}" ng-repeat="st in Profilelist" value="{{st.ProfileID}}">
{{st.ProfileName}}
</option>>
</select>
Controller
$scope.ProfileID = responce.data.data[0].ProfileID;//drop down selection
Drop down population
$scope.Profilelist = responce.data.data;
Upvotes: 0
Views: 52
Reputation: 126
just remove the curly brackets fro the ng-selected so from
ng-selected= "{{st.ProfileID == ProfileID}}"
to be
ng-selected= "st.ProfileID == ProfileID"
will work on this link http://jsfiddle.net/kn7uzrva/
Upvotes: 1