AngularJS - Binding radio buttons to models with boolean values

后端 未结 7 679
梦如初夏
梦如初夏 2020-12-02 06:30

I am having a problem binding radio buttons to an object whose properties have boolean values. I am trying to display exam questions retrieved from a $resource.

HTML

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 07:29

    I tried changing value="true" to ng-value="true", and it seems to work.

    Also, to get both inputs to work in your example, you'd have to give different name to each input -- e.g. response should become response1 and response2.

提交回复
热议问题