I have apex controller that returns Map<String, List<sObject>>
. I want to iterate through keys and through sObjects inside of parent iteration.
Apex:
@AuraEnabled
public static Map<String, List<sObject>> returnSObjectMap() {...}
Lightning Controller:
getsobjectMap : function(component) {
var action = component.get("c.returnSObjectMap");
action.setCallback(this, function(a) {
if (a.getState() === "SUCCESS") {
var sobjectFields = a.getReturnValue();
var sobjectFieldsFinal = [];
for (var key in sobjectFields) {
sobjectFieldsFinal.push({value:sobjectFields[key], key:key});
}
component.set('v.sobjectsMap',sobjectFieldsFinal);
} else if (a.getState() === "ERROR") {
}
});
$A.enqueueAction(action);}
Component:
...
<aura:attribute name="sobjectsMap" type="List"/>
...
<aura:iteration items="{! v.sobjectsMap }" var="sobjectList" indexVar="key">
<apex:iteration items="{! sobjectList }" var="sobject">
...
</apex:iteration>
</aura:iteration>
I'm receiving an error when trying so save on line:
<apex:iteration items="{! sobjectList }" var="sobject">
Error: No COMPONENT named markup://apex:iteration found
How can I iterate over inner list?