Currently facing an obstacle with checkboxes in ionic2.
Here is how I am using the checkbox:
<ion-item>
<ion-label>Agree</ion-label>
<ion-checkbox color="dark" id="agree" name='agree' class="form-control" formControlName="agree" [checked]="false" ></ion-checkbox>
</ion-item>
In my .ts file, I am accessing its value like this:
console.log(this.timelogForm.controls['agree'].value);
I want it to be unchecked by default.
Main issues include :
When using formControlName="agree" it automatically gets checked.
The value in .ts file only reflects if the checkbox has been clicked. I want to return true if checked and false if not clicked upon submission.
Any assistance would be appreciated.