Symptom: Bind a list radio button always can only bind a line, tangled for a long time, home found that the original name used the same, pit Ah, record lest next time again.
The previous Code
<ul> <li ng-repeat= "row in List" > <span> {{row.name}}</span> <label class= " Radio "> <input type=" Radio "name=" abc "value=" 1 "ng-model=" Row.type ">ddddd</input> </ label> <label class= "Radio" > <input type= "Radio" name= "ABC" value= "2" ng-model= "Row.type" >DFSFD </input></label> <label class= "Radio" > <input type= "Radio" name= "ABC" value= "3" ng-model= " Row.type ">sfd</input></label> Value:{{row.type}} </li> </ul>
The code after the change
<ul> <Ling-repeat= "row in List"> <span>{{Row.name}}</span> <labelclass= "Radio"> <inputtype= "Radio"name= "Abc{{row.name}}"value= "1"Ng-model= "Row.type">Ddddd</input> </label> <labelclass= "Radio"> <inputtype= "Radio"name= "Abc{{row.name}}"value= "2"Ng-model= "Row.type">Dfsfd</input></label> <labelclass= "Radio"> <inputtype= "Radio"name= "Abc{{row.name}}"value= "3"Ng-model= "Row.type">SfD</input></label>Value:{{row.type}}</Li> </ul>
Angular JS Radio Button