I am quite new to APex and LWC and I am not sure how to format my code I would like to trigger an apex class from a loop if it was another LWC I would do but since it is from the same component I am not sure how to do it.
So I am looping through the status of one of my objects in the following way:
<div class="card_wrapper">
<template for:each={pickVals} for:item="item">
<div class="stageContainer" key={item} style={calcWidth}>
{item}
</div>
</template>
</div>
now instead of item I would like there to trigger an apex class that count the number of object with that Status:
@AuraEnabled(cacheable=true)
public static list<AggregateResult> PropCountStatus(string CountryId, string Status){
return [SELECT count (Name)
FROM Lead
WHERE Market__c = :CountryId
AND Status = :Status ];
}
How in my HTML can I trigger the current item in my apex class and return the value from my APEX class
Thx you very much