0
I am starting in Angular in my high school and need to do a project of a medical site. In one of the parts I have the following template:
<div class="container mt-5 mb-5">
<h3>Qual a doença?</h3>
<div class="container" *ngFor="let doenca of doencas;let i= index">
<div class='col-2'>
<div class="form-check">
<input type="checkbox" class="form-check-input" [(ngModel)]="paciente.doenca" name="{{doenca}}" >
<label class="form-check-label" for="exampleCheck1">{{doenca}}</label>
</div>
</div>
<p *ngIf="paciente.doenca==true && doenca=='febre'">
<input type="radio" name="alta">Febre alta
<input type="radio" name="media">Febre media
<input type="radio" name="baixa">Febre alta
</p>
</div>
</div>
and the following code:
paciente:Paciente;
doencas=["febre","desmaio","vomito"];
I want when clicking the checkbox to change the value of the attribute of the corresponding disease in the patient and after that to appear the tag "p" with the rest of the questions related to the disease. But the way it is, when I click all the checkboxes are marked. How to solve?
It was not clear your question, could post as is the class Patient?
– LeAndrade
Here’s the Github link to make it easy (the code that’s giving you trouble is on Edit-pediatra) :https://github.com/JuanGustah/PO
– Juan Gustavo