I am trying to make my div use class template if and only if some value is equal to 0. If the value is greater than 0, I want to use another class. How do I go about it easily?
<a (click)="onItemsHeaderPanelClick()"
[class.proj-style-display-flex.linked-items-label]="linkedItems.length > 0"
[class.proj-style-display-flex.linked-items-label-disabled]="linkedItems.length == 0">
... </a>
<span [ngClass]="[linkedItems.length ? 'case-yes-class' : 'case-no-class']">content</span>
Happy coding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With