I am currently using an ion-slides component with a template-driven form on it which i am using to view data from an array of objects. I have 2 buttons which is used to slide to previous and next slides. With these 2 buttons, I can check the form validity. Unfortunately using the swipe gesture, i cannot detect the form validity. Please check some code below. Hope it can help to
<ion-slides (ionSlideWillChange)="getForm(empForm)"> <ion-slide class="ion-slide-main" *ngFor="let employee of employees"> <button type="submit" (click)="goToNextSlide(empForm)"> </button></div> <form novalidate autocomplete="off" #empForm="ngForm"> <ion-row class="emp-row"> </ion-row> </form> </ion-slide> </ion-slides>
I am guessing since the template variable empForm is outside the for loop, it is not possible to access each form instance created in the for loop. Can someone advise how I may access those form instances?