Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Changing button color or icon dynamically

$
0
0

Hi guys,

Like you know you can add color to a button

<button positive>Test</button>

And, you can add an icon to an item

`<ion-item>
   <icon cube item-left></icon>
   item 1
</ion-item>`

Now, I would like to be able to dynamically change the button color or the icon type. Something like:

<button {{ newColor }}>Test</button>

and

<icon {{ newIcon }}></icon>

What is the solution for that problem?

Maybe NgClass? I tried and could not make it work. :frowning:

Thanks in advance


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>