2

Does anyone know how to get sub-groups in an ng-option list. I have a query that looks something like this that works fine.

l.symbol as l.description group by l.country for l in locations

but I would ideally like to do this which does not work:

l.symbol as l.description group by [l.region, l.country] for l in locations

the expected result in the dropdown that I am after would then look like this:

AMER
  CANADA
    MONTREAL
    TORONTO
  USA
    CHICAGO
    NEW YORK
APAC
  China
    Bejing
    Shanghai
  Japan
    Kyoto
    Tokyo

Is this even possible out of the box?

Florian Hehlen
  • 103
  • 1
  • 4
  • Check these answers : [how-to-indent-multiple-levels-of-select-optgroup-with-css](http://stackoverflow.com/questions/5288792/how-to-indent-multiple-levels-of-select-optgroup-with-css) , [nesting-optgroups-in-a-dropdownlist-select](http://stackoverflow.com/questions/1037732/nesting-optgroups-in-a-dropdownlist-select) – Ilan Frumer Jan 22 '14 at 12:29
  • Thanks. I would prefer a solution that is built in to AngularJS. I will take a look as I might have to resort to this in the end. – Florian Hehlen Jan 22 '14 at 14:01
  • I can not see in the Select2 documentation how to do this. On a side-note Select2 seems to solve every other problem I have with dropdowns... so great tip no matter what. – Florian Hehlen Jan 24 '14 at 13:53
  • @DavinTryon, select2 is NOT part of the angular UI suite and requires jQuery. There is a separate project called ui-select that IS part of the angular UI suite and does NOT require jQuery. – icfantv Feb 12 '16 at 20:12

0 Answers0