angularjs - I can't select a default value from a select option -


i have problem in selecting default value of select option when try load page,this code:

<select ng-model="sortkey" class="ng-valid ng-pristine"> <option value="lastname" selected="selected">nom</option> <option value="firstname">prenom</option> <option value="class">classe</option> </select> 

i have used selected="selected" attribute have problem

enter image description here

thanks help

this demo:

<select ng-model="sortkey" style="border-radius: 20px;width: 135px;height: 32px;margin-left:     0px;margin-right: 22px;" class="ng-valid ng-dirty ng-pristine">    <option selected value="lastname" >nom</option>    <option value="firstname">prenom</option>    <option value="class">classe</option>  </select>


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -