Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

On reload show the last state of ion-button

$
0
0

@RajuDhami wrote:

Im trying to save the button states on page reload.
Right now Im able to show hide checkin and checkout button.

On page load checkin button is showing, but I would like to know if I clicked checkin it shows me checkout.
If i refresh when the button checkout was active, I want it to be on checkout.

Anyway I can do this, thanks.

home.html

<ion-button *ngIf=“buttonShow” class=“buttons” color=“tertiary” type=“submit” (click)=“checkedin()”>
Check In

<ion-button *ngIf=“buttonHide” class=“buttons” color=“tertiary” type=“submit”(click)=“checkedout()”>
Check Out

Note: not sure why the ion-button close is not showing up in the above section while writing here.

hote.ts

buttonShow: boolean = true;
buttonHide: boolean = false;

checkedin() {
let dathis.buttonShow = !this.buttonShow;
this.buttonHide = !this.buttonHide;
}

checkedout() {
this.buttonShow = !this.buttonShow;
this.buttonHide = !this.buttonHide;
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>