Consider html as below we need to set text to if any one select multiple items from list.
1 2 3 4 5 6 7 |
<md-input-container> <md-select multiple md-selected-text="getSelectedText(filterData.selectedPageStatus,'Filter by Page Status')"> <md-option value="{{pageStatus}}" ng-repeat="pageStatus in PageStatusList"> {{pageStatus}} </md-option> </md-select> </md-input-container> |
and here is the functions for that.
1 2 3 4 5 6 7 8 9 |
$scope.getSelectedText = function (data, ddlText) { if (data == undefined || data.length == 0) { return ddlText; } else { var text = data.length + ' item(s) selected'; return text; } } |
Please drop comment if you have any problem 🙂