nb-checkbox getting checked/true all instead checked one

Viewed 677

i'm using nebular checkbox https://akveo.github.io/nebular/docs/components/checkbox/overview#nbcheckboxcomponent i'm trying to create a quiz app, here's my code

<form [formGroup]="quizAnswer" class="step-container">
    <nb-stepper #stepper disableStepNavigation>
        <nb-step label="First step" *ngFor="let question of quizDetail?.questions">
            <p style="font-size: 20px;"><b>{{question.name}}</b></p>
            <div style="padding: 10px;background: rgba(92, 143, 255, 0.274);margin-bottom: 5px;border-radius: 5px;"
                [ngClass]="{'selected': checked == true}"
                *ngFor="let option of question.options; let i = index">
                <nb-checkbox status="basic" formControlName="answer" [value]="option.isAnswer">
                    {{option.name}} {{ checked }}
                </nb-checkbox>
            </div>
            <button style="margin-top: 20px;" nbButton nbStepperNext>next</button>
        </nb-step>
        <nb-step>
            <div class="step-container">
                <h3>Quiz completed!</h3>
                <button nbButton (click)="submit()">Submit</button>
            </div>
        </nb-step>
    </nb-stepper>
</form>

how can i get all the responses?

for example i created repo for this https://stackblitz.com/edit/nested-form-array-example-wgk1cx

0 Answers
Related