ternary operator in ngclass angular 10 code example Example: ngclass ternary <div [ngClass]="varA === varB ? 'css-class-1' : 'css-class-2'">