I currently have a child component to which I pass some map values from a parent component to an attribute in the child component on the client side. I used an example which gets map values from serverside.
I am getting the mapvalues from client side but want to remove the serversidepart from the controller
I currently have the following
Component
<aura:attribute name="mapValues" type="object" />
<aura:handler name="init" value="{!this}" action="{!c.getMapValues}"/>
Controller
getMapValues : function(component, event, helper) {
var action = component.get("c.getMap");
action.setCallback(this, function(response){
var state = response.getState();
var result = component.get("v.mapValues");
var arrayMapKeys = [];
for(var key in result){
arrayMapKeys.push({key: key, value: result[key]});
}
component.set("v.mapValues", arrayMapKeys);
});
$A.enqueueAction(action);
}
I am expecting to be able to do the following:
getMapValues : function(component, event, helper) {
var result = component.get("v.mapValues");
var arrayMapKeys = [];
for(var key in result){
arrayMapKeys.push({key: key, value: result[key]});
}
component.set("v.mapValues", arrayMapKeys);
}
This throws me the error:
Action failed: aura:iteration$controller$itemsChange [Maximum call stack size exceeded]