[Fixed]-How to use django choice in angularJS

1👍

It seems like you are getting data from API and binding to form. So in your case you could use ng-model over radio inputs.

But before that 1st thing you need to bind whole object to $scope.user = data;. Additionally I assumed that radio values would be M & F.

HTML

<div class="radio-item">
  <div class="label-text">Пол</div>
  <div class="item">
    <input type="radio" name="sex" id="male" ng-model="user.gender" value="M">
    <label for="male"><span></span> Male</label>
  </div>
  <div class="item">
     <input type="radio" name="sex" id="female" ng-model="user.gender" value="F">
     <label for="female"><span></span> Female</label>
   </div>
</div>

Leave a comment