Angular ng-options remove blank option and select the first option only

后端 未结 2 1842
我寻月下人不归
我寻月下人不归 2021-01-14 05:44

I am using AngularJS to populate my select options content dynamically from an array of objects in my controller. My objects has a property named userProfileName

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-14 06:22

    This has several solution. The following worked best for me. Just initialize the model with the first value. The ng-init="myItem = items[0].name" does the trick

    
    

提交回复
热议问题