I ran into a strange Angular behavior... I don't know if it ever happened to any of you.
Binding variable applying the traditional binding by using the double curly brace syntax is not going to work as expected, it will replace previous classes already associated instead of appending.
Did you know how to concatenate classes instead of replacing existing ones?
As you can see from this example, here it replaces the classes associated with mat-raised-button
of material.
Simple test case :
html
<button mat-raised-button class="myClass">BUTTON</button>
<button mat-raised-button class="{{test}}">BUTTON</button>
.ts
export class AppComponent {
...
test = 'myClass';
...
}
css
.myClass {
background: red;
}