Home > database >  Angular multiple ng Class
Angular multiple ng Class

Time:10-29

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.

  1. use deal-form-date-picker
  2. 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

  • Related