mercredi 31 octobre 2018

Angular 6 - In MCQ, [(ngModel)] show the good answer

I'm working on a MCQ in Angular 6. I have a problem with my checkboxs which show the good answer straight away because of this line: [(ngModel)]="answer.good". But the problem is that without this line i can't determine if the answers are good or bad.

answer.component.html :

<div class="" *ngFor="let answer of answers">
    <div class="answer">
        <label class="container"> 

            <input type="checkbox" 
                [(ngModel)]="answer.good" />
            
            <span class="checkmark"></span>

        </label>
    </div>
</div>

Does someone has a solution ?




Aucun commentaire:

Enregistrer un commentaire