search

Home  >  Q&A  >  body text

angular.js - angularjs single choice issue


How to implement single selection

and add it to the database

PHPzPHPz2831 days ago538

reply all(1)I'll reply

  • 为情所困

    为情所困2017-05-15 17:05:48

    If you want to single-select, the ng-model of input[radio] needs to be the same, use value to control the value, and then detect the change of this value to change your permission.

    <label>
        <input type="radio" ng-model="permission" value="0">
        无管理权
      </label><br/>
      <label>
        <input type="radio" ng-model="permission" ng-value="1">
        部门管理权
      </label><br/>
      <label>
        <input type="radio" ng-model="permission" value="2">
        全员管理权
      </label>

    reply
    0
  • Cancelreply