Alert in Alert closing the first


#1

I have managed to open an alert with in an alert. But when I choose Admin I want to close the first alert after the user chooses Admin.

How can I do that?

showAlert2(message)
{
let alert = this.alertCtrl.create({
  title:'Sign in as',

  inputs: [
    {
      type:'checkbox',
      label:'Admin',
      value:'admin',
      handler: data => {
        this.showAlert3('Sign in');
      }
    },
    {
      type:'checkbox',
      label:'Patient',
      value:'patient'
    }
  ],

  buttons: [
    {
      text: 'Login',
      handler: data => {
        // if the user chooses patient open a page
        this.navCtrl.push(PMainPage);
        // if the user chooses admin i want to create an other alert message
      }
    }
   ]
  });

   alert.present();
 }

Thank you in advance!


#2

thanks for everyone how replied by the way :slight_smile:
solution: http://plnkr.co/edit/8abBqnLpDs1Ql7Ibdixe?p=preview