how to put a ternary condition in class of angular code example Example: ngclass ternary <div [ngClass]="varA === varB ? 'css-class-1' : 'css-class-2'">