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

[IONIC 4] Progress bar not progressing while uploading file

$
0
0

@AdamGelineau wrote:

Hi guys !

I’m implementing a simple progress bar in my Ionic 4 project, but it doesn’t progress at all while I’m uploading a file unless I click anywhere on my app.
If I don’t click, it juste stays at 0, but when I click somewhere, the progress bar gets updated so it progresses.

How to do to make it progress without clicking anywhere ?

Here’s my ts file:

export class MyUploadPage implements OnInit {

    uploadPercent: any = 0;
    videoFileUpload: FileTransferObject;

    constructor(...) {}

    this.videoFileUpload.onProgress((data) => {
          this.uploadPercent = Math.round(data.loaded / data.total);
    });
}

Here’s my progress bar:

<ion-row class="uploading">
  <ion-col text-center>
    <ion-progress-bar [value]="uploadPercent"></ion-progress-bar>
  </ion-col>
</ion-row>

Any ideas ? Thanks !

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70770

Trending Articles



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