How do I update the LoadingController Content after it has been created

Please am having a small challenge, I want to be able to update the content of my LoadingController after it has been created. What I actually wanted is a progress bar showing in the content, the content will be updated every 5seconds.

presentLoadingCustom() {
  let loading = this.loadingCtrl.create({
    spinner: 'hide',
    content: `
      <div class="custom-spinner-container">
        <div class="custom-spinner-box"></div>
      </div>`,
   
  });

On the documentation for LoadingController there is no way you can update the content after it has been created.

Please is there a way to update it?

1 Like

Looking forward for a solution aswell!

Agreed - need the ability to show dynamic content on the loading screen. Is there a way?

Looks like this (undocumented?) setContent() method seems to work. I had to execute this inside an ngZone.run() as suggested here:

Create a service that listens to your download action, and then takes steps accordingly. There’s a progress bar component on Josh Morony’s blog, so that’s one place to look. I wouldn’t rely on unsupported loadingController methods. If a method isn’t official, it probably isn’t ready for prime time.

There’s another progress bar implementation in the comments of ionic #6669.