I am building an aura lightning component that displays a timeline. I have two lists, one that returns all the steps in the timeline, and the second list that returns the current active number of steps in the timeline. I am iterating over the first list to display all the steps in the timeline, which works correctly. With the second list I'm trying to implement which steps are active based on the number of elements in the list. For example, if the first list contains 12 elements (total number of steps) and the second list contains 5 elements (total number of active steps) then I'd like to alter the variant of the icon to display as successful. Is there a way to iterate over that second list to change the variant to success
for the number of current steps out of the total number of steps that is being iterated over?
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" controller="TimelineController" access="global" >
<aura:attribute name="recordId" type="String" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="steps" type="List" />
<aura:attribute name="currentSteps" type="List" />
<table class="slds-table slds-table_cell-buffer slds-table_fixed-layout slds-table_bordered slds-table_col-bordered">
<thead>
<tr class="slds-line-height_reset slds-text-title--caps">
<aura:iteration items="{!v.steps}" var="step">
<th scope="col">
<div class="slds-truncate" title="{!step}">{!step}</div>
</th>
</aura:iteration>
</tr>
</thead>
<tbody>
<tr class="slds-hint-parent">
<aura:iteration items="{!v.steps}" var="step">
<td>
<div class="slds-truncate">lightning:icon iconName="action:approval" /></div>
</td>
</aura:iteration>
</tr>
</tbody>
</table>
</aura:component>