SoFunction
Updated on 2025-04-11

angular select default value setting method

As shown below:

<select ng-model="selected" ng-options=" as  for x in users"></select>
$ = [
    {name:'a',id:'1'},
    {name:'b',id:'2'},
    {name:'c',id:'3'}
  ];
  $='2';//The value of id, distinguishing between types  $=$[0].id;//If you want the first value

The above angular select default value setting method is all the content I share with you. I hope you can give you a reference and I hope you can support me more.