Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49258

Run button handler asynchronously

$
0
0

@Kyrax80 wrote:

Hi, I have an alert controller which has some checkboxes, but the handler takes too long to finish.

What I want is to click the checkbox and that the handler is handled asynchronously, meaning that I don’t have to wait for it to finish. Adding async didn’t work.

My code for this is:

this.listaVideosAux.forEach(lista => {
      alert.addInput({
        type: 'checkbox',
        label: lista.nombre,
        value: lista.nombre,
        checked: true,
        handler: async checkBox => {
          if (checkBox.checked) {
            this.categoriasFiltro.push(checkBox.value)
          } else {
            this.categoriasFiltro = this.categoriasFiltro.filter(categoria => categoria != checkBox.value)
          }
          this.filtrar();
        }
      });
    });

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49258

Trending Articles



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