0
Good afternoon,
I’m making an application in Ionic 3 using the Restful API with php for connection to the MYSQL database and my app lists rooms of a house with its respective consumption, follows images of the app currently:
When I click on this View Details button I would like the id of the chosen room to pass to the other page, follow the codes:
Home.html
<ion-item-sliding *ngFor="let comodos of comodo">
<ion-item>
<ion-avatar item-start>
<img src="../assets/img/ionic3-ico.png">
</ion-avatar>
<h2>{{(comodos.descricao)}}</h2>
</ion-item>
<ion-item-options side="left">
<button ion-button color="dark">
<ion-item class="transparente">
<ion-icon name="flash" color="primary" item-left></ion-icon>
<span>{{(comodos.potencia_atual)}} Wh</span>
</ion-item>
</button>
</ion-item-options>
<ion-item-options side="right">
<button ion-button color="warning" (click)="doSearch(comodos.id)">
<ion-icon name="home"></ion-icon>
Ver Detalhes {{(comodos.id)}}
</button>
</ion-item-options>
</ion-item-sliding>
Home.ts
public doSearch(id_comodo) {
this.nav.setRoot(TripsPage, {id: this.id});
}
is because this.id has stored the user id and I didn’t know how the comodo id passed, thanks for the reply.
– André Paiva