I have this value Rating=7 in my database and I am getting this value and storing on editUserDetails={}. Now I am displaying 5 to 9 radio buttons in the browser and I want to select the radio button according to the database value. I mean I want to select the radio with value = 7. I wrote this code but it is not working. What's the issue and what I need to put. Can someone please help?
my Html
<div class="col-md-6" *ngFor="let Rating of rates">
<input type="radio" name="Rating" [value]="Rating" [checked]="radioChange(Rating)">
{{Rating.rating}}
</div>
my Ts
rates:any=[
{rating:"5"},
{rating:"6"},
{rating:"7"},
{rating:"8"},
{rating:"9"},
]
radioChange(Rating){
var match=false;
if(this.editUserDetails.Rating===Rating){
match=true;
}else{}
this.temp = 0;
return match;
}