javascript - ng-options: how to put empty option at the end? -


currently, i've got (simplified):

<select ng-model=model.policyholder ng-options="person.index person.name person in model.insurance.persons">   <option value>someone else </select> 

this creates dropdown options person names , empty 1 "someone else" @ top. question is, how empty option at bottom of dropdown?

i keep using ng-options this, since controlling position of default option seems small change justify more verbose <option ng-repeat> way.

thanks!

use option value=""

like:

<select ng-model="model.policyholder" ng-options="person.index   person.name person in model.insurance.persons">   <option value="">someone else</option> </select> 

if want show someone else @ bottom when click on drop-down list can use.

<select ng-model="model.policyholder">     <option ng-repeat="person in model.insurance.persons" value="{{person.index}}">{{person.name}}</option>     <option value="">someone else</option> </select> 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -