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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -