javascript - ngModel not working -
$scope.callfunction = function() { console.log($scope.modeldata); }
<md-select ng-model="modeldata" ng-change="callfunction()"> <md-option ng-repeat="x in tempdata" ng-value="x">{{x}} </md-option> </md-select>
i'm trying use md-select select boxes ng-model doesn't seem work. idea i'm going wrong?
the output in ng-change function comes undefined.
the models accessible via $scope
in controller $scope.modelname
// sometime data might not bind object in case declare not $scope.modelname; $scope.callfunction = function() { console.log($scope.modelname); }
<md-select ng-model="modelname" ng-change="callfunction()"> <md-option ng-repeat="x in tempdata" ng-value="x">{{x}} </md-option> </md-select>
Comments
Post a Comment