J. Petersen J. Petersen - 1 month ago 9
AngularJS Question

can only select a ONE radio repeater

It is such that I have a repeater, which has two radios, the two must select only one of them.

If you click on one, then the other will be disabled and vice versa if it should be that way.

So if it is so must be True A and B must be False. so there will only ever be a departure.

index.html:

<div class="col-md-6" ng-repeat="pric in UserPrice">
<div ng-class="{'PopAddNow': pric.Mdr < 6, 'PopAddNow': pric.Mdr >= 6}" class="padding" style="padding:2px 3px;">
<input type="radio" value="{{pric.Prics}}" ng-model="Pakke1" />
Members - {{pric.Mdr}} months {{pric.Prics}}
</div>
</div>


What the problem is right now, it's such a and b can be true together. it may be they do not, you have to choose only one of these.

Answer

As per standard HTML, make sure the radio buttons have the same value for the name attribute. E.g.:

<input name="pakke1" type="radio" value="{{pric.Prics}}" ng-model="Pakke1" />