Issue
Whenever I click on the radio button "second" I have to click it twice for that to be selected.
does ngModel not accept! (negation)?
<div class="form-check">
<label class="custom-radio black">first
<input type="radio" name="name" required [value]=false [(ngModel)]="!selectedValue" class="black" checked="true">
<span class="checkdot"></span>
</label>
</div>
<div class="form-check">
<label class="custom-radio black">second
<input type="radio" name="name" [(ngModel)]="selectedValue" required [value]=true checked="true" class="black">
<span class="checkdot"></span>
</label>
</div>
Solution
This should be [(ngModel)]="selectedValue"
same for both,
as its radio button so it can have only one value at a time, there is no need of checked="true"
also, it will be marked once [(ngModel)]
and [value]
has same value
Answered By - Vivek Doshi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.