I have the following simple code:
@Page({
template: `
<ion-content>
<form (submit)="submit()">
<ion-item>
<ion-label>Some Toggle</ion-label>
<ion-toggle [(ngModel)]="toggle"></ion-toggle>
</ion-item>
<div *ngIf="toggle">some content 1</div>
<div *ngIf="!toggle">some content 2</div>
<button type="submit">Submit</button>
</form>
</ion-content>
`,
})
export class TestPage{
submit(){
console.log("form submit");
}
}
The problem is that whenever I click on the toggle the form calls the submit function.
Does anyone have a solution to this problem?