I am iterating over data and want to set element class based on value. Is there are way to check if element.Id exist? If true is not an option for me.
<template for:each={data} for:item="element" for:index="inx">
<p class = {testClass}>
{element.Id}
</p>
</template>
js
get testClass(){
if(element.Id) {
return 'someClass'
} else {
return 'anotherClass'
}
}