I am trying to add a class to an Item depending on whether or not this same class exist in another Item.
In the following code, I used data binding with classList but it didn't work:
<ion-item #firstItem>
<ion-label>My label</ion-label>
<ion-input type="text" formControlName="myInput"></ion-input>
</ion-item>
<!-- ....... -->
<ion-item [class.myClass]="firstItem.classList.contains('myClass')">
<ion-input value="myValue" readonly></ion-input>
</ion-item>
My goal is whenever the firstItem has the class myClass, it will be added automatically to the second item, but all I've got is an undefined classList
Do you have any idea why my previous code isn't working?
Thanks