Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic AlertController and HTML code

Hi want something like this and also assigned the css to each div and address block. Is it possible???

let alert = this.alertCtrl.create({
            title: 'Contact Us',
            subTitle: `
                <div class="address-block pp-notes-row">

                    <address></address>
                </div>
            `,
            buttons: ['OK'],
            cssClass: `
                .alert-wrapper {
                    width: 100%
                }

                .address-block {
                    text-align: left;
                }
            `
        });
        alert.present();
like image 574
Mujibur Rehman Ansari Avatar asked Sep 02 '26 11:09

Mujibur Rehman Ansari


1 Answers

You can do like this

let alert = this.alertCtrl.create({
  title: '<h1 class="c-no-margin winner-alert-title">Congratulations!</h1>',
  message: '<div>' +
  '<p class="c-no-margin">You are the WINNER, now please submit your details to your favourite celebrity and get video call.</p>' +
  '</div>',
  buttons: [
    {
      text: 'Select Celebrity',
      handler: () => {
        this.navCtrl.push("CelebrityList");
      }
    }
  ]
});
alert.present();
like image 120
Umesh Patadiya Avatar answered Sep 05 '26 03:09

Umesh Patadiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!