AngularJs: How to set radio button checked based on model

前端 未结 6 1419
礼貌的吻别
礼貌的吻别 2020-12-05 04:10

I have a model returning in the storeLocations object with a isDefault value. if isDefault returns true, I wan\'t to set that radio button in the group as checked.

N

6条回答
  •  悲&欢浪女
    2020-12-05 04:17

    Use ng-value instead of value.

    ng-value="true"
    

    Version with ng-checked is worse because of the code duplication.

提交回复
热议问题