Support disabling options in select with ng:options
Need a way to construct
<select>
<option disabled>A</option>
<option>B</option>
<optionC</option>
</select>
There's no way to express the disabled state of a specific option with ng:options
+1
+1
+1
+1 This is extremely difficult to work out, alalonde's solution is nice but incompatible with 'group by'. At the same time though, it should be a rather simple feature to add to the existing ngOptions directive.
+1
+1 and also for @cades' syntax suggestion:
select as label disable if cond group by group for value in array
+1
+1
+1
+1
+1
FYI, This seems to work decently well:
HTML
<select ng-model="L.selectVal" class="form-control" required="required">
<option value="" disabled="disabled" selected="selected">-- Select Thingy --</option>
<option ng-repeat="thingy in L.things" value="{{thingy.id}}">{{ thingy.label }}</option>
</select>
Jade
select.form-control(ng-model="L.selectVal" required="required")
option(value="" disabled="disabled" selected="selected") -- Select Thingy --
option(ng-repeat="thingy in L.things" value="{{thingy.id}}") {{ thingy.label }}
@coolaj86 Not recommend because ng-repeat inside a select will not render correctly on IE. There is an open issue for it : https://github.com/angular/angular.js/issues/2809
+1
+1
another +1 for @cades recommendation, it's exactly what I was hoping for
select as label disable if cond group by group for value in array
+1
+1
+1 @alalonde and @vikasgulati - Thank you both for a great fix for this issue. Has anyone updated this directive to be compatible with Group By?
+1
+1