Is it possible to exchange information between two pages using logic?
I have successfully implemented a checklist, but I am unsure how to add a success/error icon next to the Room name on the 'verifyplace.html' page after invoking the goToNextPage() function. How can I achieve this transition between different pages?
Here are the files for the respective pages (.html and .ts):
verifyplace.html:
<ion-list>
<button ion-item (click)="openRoom()">Room</button>
</ion-list>
my verifyplace.ts:
openSala(){
this.navCtrl.push(VerifyroomPage);
}
my verifyroom.html:
<ion-list>
<ion-item *ngFor="let item of checkRoom">
<ion-label>{{ item.title }}</ion-label>
<ion-checkbox [(ngModel)]="item.checked" color="secondary"></ion-checkbox>
</ion-item>
<button ion-button color="secondary" (click)="goToNextPage()" full>Finish</button>
</ion-list>
my verifyroom.ts:
public checkRoom = [
{
title: 'Checklist 1',
checked: false
},
{
title: 'Checklist 2',
checked: false
},
{
title: 'Checklist 3',
checked: false
}
];
goToNextPage() {
if (this.checkSala.filter(c=>c.checked == false).length == 0) {
this.navCtrl.push(VerifyplacePage);
/*return a success icon on the previous page*/
} else {
this.navCtrl.push(VerifyplacePage);
/*return an error icon on the previous page*/
}
}