question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AlertController: possibility to add <ion-icon> in message parameter

See original GitHub issue

When createing an AlertController object:

let alert = this.alertController.create({
   title: "My title",
   message: 'Some message'
});

it would be great if we could add an ion-icon in the message, like this:

let alert = this.alertCtrl.create({
    title: this.translate.instant("tos.title"),
    message: '<ion-icon name="add-circle"></ion-icon>some text'
});

the ion-icon is removed (not rendered). First I thought the framework was removing html markup, but html standard tags (h1, h2, p, etc…) are not.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:10
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
MvRemmerdencommented, Aug 17, 2017

The place you moved it to is not available anymore. Any chance to see the progress or get some indication of the very rough expected timeline?

12reactions
jtushar53commented, Jan 4, 2017

Also Toast can have icons, maybe some thing like

let toast = this.toastCtrl.create({
              message:'message',
              icon : "information"
            });

or may be the approach like OP

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-alert: Ionic API Alert Buttons with Custom Message Prompts
ion-alert dialog presents or collects information using inputs. Custom alert button messages appear above the app's content and must be manually dismissed.
Read more >
AlertController - Ion-icon with the text in the buttons
Is that possible to display a ion-icon in the button with the text in AlertController? I tried below code but no luck. let...
Read more >
Ionic 5 Alert, Confirm and Prompt Component Tutorial with ...
To create Alerts, we need to import the AlertController class from '@ionic/angular' then add in the class constructor() method to use its ...
Read more >
Using alerts in Ionic - Daily Dev Tips
Adding alerts to prompt users for specifc actions or inputs in Ionic. ... alertController.create({ header: "Alert", message: "Choose an ...
Read more >
How to Build a Capacitor File Explorer with Ionic Angular
In this tutorial we will build a file explorer to create files and folders, navigate through your different folder levels and add all ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found