search

Home  >  Q&A  >  body text

angular.js - angularjs single choice issue


How to implement single selection

and add it to the database

PHPzPHPz2866 days ago568

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.

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    <code><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></code>

    reply
    0
  • Cancelreply