I am trying to add a badge on my Icons in the tabs. The current result is: http://play.ionic.io/app/decfc14cb171
Does anyone know how to put them in the top-right corner of each icon?
I tried using but it proved more problematic in other aspects, although with the "badge" attribute is was easier to achieve the desired effect. Is there a way to replicate it without using ion-tabs?
I'd advise using Ionic's ion-tabs directive, as it has "first class" support for badges. The ion-tab element has a "badge" attribute which makes it really easy to add text (in your case a number) to an icon.
I've written a demo of it in action here:
http://play.ionic.io/app/c6e96276e8fd
The code to add the tags is here:
And the result looks like this:
In the latest Ionic doc appears a different way of doing this:
Using the tabBadget and tabBadgetStyle attributes in the tab code, like this:
where it says "danger" is the color that you define in the Theme...
Hope it helps the new ones coming to find answer in 2017!
[ works only for ioinc 1 ]
See this: http://play.ionic.io/app/52586f24b84d
You need to make a class with relative position
And assign it to
<i>
tag this way, badge will be automatically adjustedSame goes for other tab
Now you can change further position of badge also by giving margin etc to span with badge.