Working with Ionic 4 has been a breeze for me. Recently, I encountered a situation where I needed to update the value of an ion-range every second by invoking a function. However, despite successfully compiling the code, the changeMark function never seemed to get called.
Below is the HTML code snippet:
<ion-range color="light" pin="false" min="0" max="100" [(ngModel)]="sliderValue">
</ion-range>
And here is my TypeScript code snippet:
export class UpdatePlayer implements OnInit {
get_duration_interval: any;
sliderValue: any;
constructor(public modalController: ModalController) { }
ngOnInit() { }
play() {
....
this.get_duration_interval = setInterval(this.changeMark(), 1000);
}
changeMark(): any {
this.sliderValue = (this.audio.currentTime / this.maxDuration) * 100;
this.currentDuration = this.fmtMSS(parseInt(this.audio.currentTime));
console.log('playing time Value : ' + this.audio.currentTime);
}
}