0

I have a dropdown menu and would like to have the options all have the same class, how is this done using AngularJS?

        <select options-class="rules-option" ng-init="rule.actionId" ng-class="rules-option" ng-model="rule.selectedAction" ng-options="team.name for team in teams track by team.id">
            <option value="">Select Team</option>
        </select>

The above code doesn't appear to set classname of any of the generated options

Claies
  • 22,124
  • 4
  • 53
  • 77
Zabs
  • 13,852
  • 45
  • 173
  • 297

1 Answers1

0

You can apply CSS to elements

like

select option
{
  color:red;
  font-style:italic
}

If you need more generic way i would suggest refer this link

OR

<select ng-model="Blah">
      <option ng-repeat="person in persons" class="<your class>">{{person.Name}}</option>  
    </select>

Here is the Sample

Community
  • 1
  • 1
user3249448
  • 1,369
  • 2
  • 14
  • 34