0

Now I am working in an search functionality module using angularjs, search functionality is implemented by multiple select options, user can select more than one option in select tag, it's not a problem, but I am facing issue to load the saved search details into the select tag,(have to show pre-selected search data into the select tag)

<select name="" ng-model="sex" multiple ng-options="sex.name as sex.name for sex in choosesex">
</select>

which displays the list like Male and Female like below,

$scope.choosesex = [{ID:1,name:"Male"},
                  {ID:2,name:"Female"}];

I have get the json response from saved search, while pushing the result into the ng-model it doesnot show the selected option in select tag, Please share your opinions regarding this issue to fix. Thanks in advance.

1 Answer 1

1

sex.name as sex.name is not right. Try this:

<select name="" ng-model="sex" multiple ng-options="sex as sex.name for sex in choosesex"></select>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.