Mujibur Rehman Ansari
Mujibur Rehman Ansari

Reputation: 663

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();

Upvotes: 2

Views: 14610

Answers (1)

Umesh Patadiya
Umesh Patadiya

Reputation: 740

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();

Upvotes: 9

Related Questions