Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71529

Change label color dynamically in Ionic2

$
0
0

@carlosadrian wrote:

favorite
I have a string property with values like "primary", "secondary" or "danger". I am able to bind it to a badge in this way:

<ion-badge class="badge badge-{{product.colorStock}}">1</ion-badge>

But I am not able to do the same with a label (this does NOT work):

<ion-label class="label label-{{product.colorStock}}">Text</ion-label>

How could I bind my property to the label so it changes its color?

Thank you

Posts: 6

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 71529

Trending Articles



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