Signup for the Ionic Newsletter to get the latest news and updates!

  • Militello Salvatore

    Ok, but so it is necessary to tap the OK button. Is it possible to do the same in a Loading component and close it only after the async call is terminated?

  • Bengt Weiße

    you should build a promise chain instead of nesting them. Promises are there to avoid a callback pyramids of doom 😉

    • http://www.alexweber.com.br/ Alex Weber

      Agreed, the code could be made a bit more elegant like that:

      “`
      handler: () => {
      return this.data.load().then(()=>{
      return alert.dismiss();
      }).then(() => {
      this.nav.pop();
      });
      return false;
      }
      “`

      • Kamil Rykowski

        So that’s the way to handle promise chain. Thanks man!

      • Mike Hartington

        Not really the point…but ok.

  • Haider Rasool

    Your Promise code helped me made one. Thanks 🙂