Q:

angular2 - Change color button dynamically

I am creating an application in angular 2 and typescript.
I want to put some background color in my buttons depending on an variable.
<div>
  <button md-button>1. Choose travel</button>
  <button md-button>2. Choose seats</button>
  <button md-button>3. Fill data</button>
  <button md-button>4. Pay</button>
</div>

I have a variable in my component:
currentStep: number = 1; //1 Select travel, 2 Choose seats, 3 Fill data, 4 Pay

And for example, I want that when the currentStep is equal to 3, the third button change his background color to blue.
Which is the best way to achieve this ?
Thank you.

A:

You can use ngClass:
[ngClass]="{'fill-data-btn': currentStep == 3 }"

In you css:
.fill-data-btn{
background-color: blue;
}

Just to give you an idea.

