Ionic AlertController和HTML代码

Muj*_*ari 2 ionic-framework ionic2

嗨想要这样的东西,并将css分配给每个div和地址块.可能吗???

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();
Run Code Online (Sandbox Code Playgroud)

Ume*_*iya 9

你可以这样做

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();
Run Code Online (Sandbox Code Playgroud)