0
私はドロップダウンメニューを持っており、オプションはすべて同じクラスを持っていますが、AngularJS ?Angular 1.xのng-optionsを使用して、ドロップダウンメニューの各オプションに同じクラスを設定する方法
<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>
上記のコードでは、より汎用的な必要がある場合は、
select option
{
color:red;
font-style:italic
}
ような要素
にCSSを適用することができ、生成オプション
ちょうど 'option'要素に' NG-repeat'を使用しています。 'ng-options'の高度な機能を使っているようには見えません... –