Adding CSS class to an existing button

thank you for your reply!
I have just tried using ngClass (used https://forum.ionicframework.com/t/ionic2-ng-class-on-ion-row-scss/48935/6 as reference)

Code:

.html file:

    <h2 ng-class="textColor">Score Multiplier</h2>
        <ion-grid class="rates_container">
            <ion-col>
                <button #buttoncolor ion-button round (click)="changeColor()" class="roundClicked">x1</button>
            </ion-col>

.ts file:

public textColor: any;

    changeColor() {
        alert("function changecolor");
        this.textColor = 'red';
    }

.scss file:

    .red {
        background: #f53d3d;
    }

However when the button is clicked this does not have any effect on the text.

1 Like