使用Angular获取select选中的值

使用Angular-Leaflet-directive获取select选中的值

  • html
<select class="form-control" ng-model="selectValue" ng-change="selectedChange(selectValue)">
      
      <option style="display:none" value="">
        <strong>请选择strong>
      option>
      <option>工作人员option>
      <option>天气option>
      <option ng-repeat="value in datas" value="{{value}}">
          {{value}}
      option>
select>
<button type="button" class="btn btn-success" ng-click="getValue()">OKbutton>
  • js
$scope.selectedChange = function (v) {
    console.log('selectedChange: ', v);
}
$scope.getValue = function () {
   console.log("selectValue", $scope.selectValue);
};

你可能感兴趣的:(AngularJS)