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

Alert works but not const alert = this.alertCtrl.create({

$
0
0

@lunneyd wrote:

Anyone able help this frustrating issue. I have simple if statement and the alert works fine but const alert = this.alertCtrl.create({ doesn’t show up on screen for some reason.

First code alert shows but second code doesn’t.

var a = 1
      if (a ==1){
        alert('testi')
      }
if (a ==1){
        let timeout;
        const alert = this.alertCtrl.create({
          title: 'Alert',
          subTitle: 'test alert',
          buttons: [{
            text: 'Disagree',
            handler: () => {
              console.log('Disagree clicked');
              clearTimeout(timeout);
            }
          },
            {
              text: 'Agree',
              handler: () => {
                alert.dismiss();
                // this.navCtrl.push('TestPage');
                clearTimeout(timeout);
                console.log('Agree clicked');
              }
            }
          ]
        });
      }

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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