I have 2 class which are , I only want to enable or use the 2 class if it met the condition which is dealDispositionFormFields.isSubtenantTakingFullSpace === 'No'
How do we create the syntax for that using ngClass ? Thanks.
- use deal-form-date-picker
- enabled-input
How do we implement multiple class using ng class in angular ? . for example I want to use deal-form-date-picker class and enabled-input class if dealDispositionFormFields.isSubtenantTakingFullSpace === 'No'
#code
class="opacity87" [ngClass]="{'enabled-input':dealDispositionFormFields.isSubtenantTakingFullSpace === 'No'}"
CodePudding user response:
Just add multiple classes and use your condition, ie.
<some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
see Angular docs