Select Not Showing Selected Values – AngularJs

Hey everyone,

I had a bit of trouble getting a selected option to show up with AngularJs. It turned out that I needed to add an ng-selected attribute:

    <select ng-model="command.Status">
        <option ng-selected="command.Status == 0" value="0">Enabled</option>
        <option ng-selected="command.Status == 1" value="1">Disabled</option>
        <option ng-selected="command.Status == 2" value="2">Deleted</option>

Check out this Stackoverflow post for more info:

Leave a Reply