0

There are several rows present on the page, in relation to it i have placed the feature of editing values of every row after opening a modal popup, now on modal below is the radio button used for Gender.

        <input type="radio" ng-model="ctrl.gender" value="{{ctrl.gender}}"/> /*Should be Male with radio button */
        <input type="radio" ng-model="ctrl.gender" value="{{ctrl.gender}}"/> /*Should be Female with radio button */

Now here ctrl.gender is holding the property either Male or female returned from server w.r.t that row.

Now i want to edit the property of Gender, by placing a radio button by default that value should be checked what is returned from server w.r.t row, but i am not able to do that and even radio buttons are also not visible

Any advice on this, where i am wrong ..

Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234

1 Answers1

0

Why do you try to refer both value with same scope. You have ng-model right. Just try like below.

<input type="radio" name="gender" ng-model="ctrl.gender" value="Male"/>
<input type="radio" name="gender" ng-model="ctrl.gender" value="Female"/>
Manikandan Velayutham
  • 2,228
  • 1
  • 15
  • 22
  • i tried that, but radio button is not visible, and not also the values when i am converting it to text input , i am getting the value returned, hence its sure that value is returned by server –  Sep 25 '17 at 13:30
  • no errors in console and under chrome elements i can see ng-value as Male and female –  Sep 25 '17 at 13:33
  • No, all edit fields are under - '
    '
    –  Sep 25 '17 at 13:37