Is it possible to use ion-icon in Alert button/message?

I have tried to use ion-icons in an AlertController:

let alert = this.alertCtrl.create({
        title: 'Erro ao conectar com o servidor',
        message: `some text <ion-icon name="refresh"></ion-icon> some other text`
})

The icon is not shown, even the tag is removed. Only appears ‘some text some other text’.
Is it possible to use?

2 Likes

Any updates? I would like to add icons to my alerts as well.

I’m using ionic 4 and adding the back ticks just renders the tags as text.

I know it’s too late. But you can add icon like below.

message: '<img src = "./assets/trash.svg" width="35px" height="35px"> Delete this file?',

1 Like