I was wrote this code for showing button after scrolling is more than 500px, but "showButton" didn't get new value.
<ion-content (ionScroll)="onScroll($event)">
<button *ngIf="showButton">Scroll Top</button>
</ion-content>
my.ts file:
showButton= false;
onScroll($event) {
if ($event.scrollTop > 500) {
console.log(this.showButton);
this.showButton= true;
}
}
This console.log shows change of "showButton", but in html it doesn't change.
"showButton" for first time get value "false" but when value change to "true" it can not listen to change, how I can solve this?