select: ng-options not supported
$scope.options = [1,2,3];
<!-- Working -->
<select ng-options="option in options"></select>
<!-- Not working -->
<md-select ng-options="option in options"></md-select>
Try:
<md-select ng-model="thing">
<md-option ng-repeat="option in options"></md-option>
</md-select>
i know this option, but i like the second option
For now this isn't supported.
@rschmukler why not just use the ng-options model?
@ilanbiala I'd accept a PR with it, otherwise ng-repeat works and there are higher priorities.
Reopening, as it is a valid issue for the backlog.
@rschmukler Would you target just a "copy" of current "ng-options" directive to support md-select? I assume we would need "md-options" for this as "ng-options" is tightly connected to "select" directive?
By supporting ng-options, would this fix the problem with not being about to set the value to null? Currently, with the following code, choosing the first option will update the model with an empty string instead of null.
<md-select ng-model="vm.leaderId">
<md-option value="">Unknown</md-option>
<md-option ng-value="leader.id" ng-repeat="leader in vm.leaders">{{leader.name}}</md-option>
</md-select>
The AngularJS docs say:
Optionally, a single hard-coded <option> element, with the value set to an empty string, can be nested into the <select> element. This element will then represent the null or "not selected" option.
So, using angular's <select>, I can select a null value by providing this option:
<option value="">Unknown</option>
I would assume that I should be able to do the same with <md-select><md-option>
+1.
md-select with ng-repeat doesn't update model, whereas ng-options updates the model. Need ng-options for md-select
+1
+1
+1
+1
+1
+1
+1
+1
Yes, I need this! I want the model to update so I can work with the selected option in the controller.
+1
+1
+1