Friday, July 17, 2015

How to set the default value of drop down list in AngularJS

the solution is quite simple and straingt forward, i hope this post can save you time on scratchin your head. put selected attribute in the Option tag.

i had put down the snippet of code as example

 <select>
        <option value='{{customer.title}}' selected>{{customer.title}}</option>
        <option ng-repeat='slaveCustomer in customer.slaveCustomerList'>{{slaveCustomer.title}}</option>
 </select>

No comments:

Post a Comment