javascript - Angular group comma separated values in select options -


i'm having problem can't group comma separated values in select dropdown options, here code:

here model:

enter image description here

angular code:

<select ng-model="attrmodel" ng-options="option.value group option.key.name option in attrmodel track option.value"></select> 

result:

enter image description here

expceted result:

enter image description here

the problem pass whole value array value <option> tag.

i not 100% sure how handle nested arrays within select can use <optgroup> it.

<select ng-model="myfixedselection">   <optgroup ng-repeat="group in attrmodel track $index" label="{{group.key.name}}">     <option ng-repeat="value in group.value track $index" >{{ value }}</option>   </optgroup> </select> 

see working plnkr


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -