Toufic Batache Toufic Batache - 10 months ago 101
AngularJS Question

Get data from md-select

I am using Angular Material to make my new web app, I want to get the selected value from an

and the problem is that I am new to angularjs and how it works. If anyone could help me, it would be really appreciated.


<md-select ng-model="userRating">
<md-option ng-repeat="rate in ratings" ng-value="rate.abbrev">

Answer Source

You can just get the value by using the $scope variable

In controller


Inorder to get the selected value on change , you can pass the selected to a function and display,

<md-select ng-change="Print()" class="inline-flex md-select-down" placeholder="Select" ng-model="model">
      <md-option ng-repeat="item in ratings" value="{{item.value}}">


$scope.Print = function(){