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:
angular code:
<select ng-model="attrmodel" ng-options="option.value group option.key.name option in attrmodel track option.value"></select>
result:
expceted result:
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
Post a Comment