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

Changing button color or icon dynamically

$
0
0

Hi @brandyshea,

I'm trying to change ionic 2 buttons colors dynamically in a way that you suggested above:

<button [attr.outline]="!item.subscribed ? '' : null">

but it doesn't work as expected. I have the next markup when my condition is TRUE:

<button class="disable-hover button button-default" outline="">Subscribe</button>

and it doesn't change the color of the button. I can solve this issue with ngClass approach but I think this is not a good way. Does ionic have some issues for now with [attr.outline]="!item.subscribed ? '' : null" or I'm doing something wrong?

I have latest ionic bundle:
Cordova CLI: 5.4.1
Ionic Version: 2.0.0-alpha.51
Ionic CLI Version: 2.0.0-beta.17
Ionic App Lib Version: 2.0.0-beta.8
OS: Distributor ID: Ubuntu Description: Ubuntu 15.10
Node Version: v4.2.6

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>