Angularjs ng-repeat not working with md-select and md-option -
i have following code use ng-repeat md-select. not working, , drop down shown blank. if use ng-repeat div or html select works. please see below,
angularform:-
<div class="col-xs-12 formclass" ng-controller="dropdowncontroller"> <md-input-container class="formclass"> <label>impacts</label> <md-select name="impact" id="impact" ng-model="impact"> <md-option ng-repeat="impact in impacts.availableimpacts" value="{{impact.id}}">{{ impact.name }} </md-option> </md-select> </md-input-container> </div>
js:-
app.controller('dropdowncontroller', function ($scope) { $scope.impacts = { availableimpacts: [ {id: '1', name: 'name1' }, { id: '2', name: 'name2' }, { id: '3', name: 'name3' } ], }; });
my angular version old 1 me md-input-container without tag work
<!--<md-input-container>--> <label>impact</label> <md-select ng-model="selectedimpact"> <md-option ng-repeat="impact in impacts.availableimpacts" value="{{impact.name}}"> {{impact.name}} </md-option> </md-select> <!-- </md-input-container>-->
Comments
Post a Comment