I want to do a progress bar when user scrolls down. When it's down all the way, the bar is 100% width.
The problem is the "per" value is not updated to view on scroll event
I have checked this and this, but none worked
Template
<ion-header>
<ion-navbar color="primary">
<ion-title>{{title}} ({{code}})</ion-title>
</ion-navbar>
</ion-header
<ion-content>
<ion-toolbar style="position: fixed; opacity: 0.8; z-index: 1" *ngIf="readProgress">
<div id="bar" color="primary">{{per}} 30%</div>
</ion-toolbar>
</ion-content>
TS FILE
this.content.ionScroll.subscribe((data) => {
if (data.scrollTop < 1) {
this.readProgress = false;
this.title='Not Scrolling';
} else if (data.scrollTop > 0) {
this.readProgress = true;
this.title='Scrolling';
}
this.per = data.scrollTop;
});