I have yet another Locker Service question. I have built a number of Lightning components over the last few months, and they all work great, but when I enabled Locker Service I noticed that places where I use a For Loop, the components fail.
The following has a Map<String, String>
returned, and it works great when Locker Service is not enabled.
doInit : function(component, event, helper) {
var action = component.get("c.findAll");
var theAmens = component.get("v.AmenityList");
action.setParams({ 'amenityTypes' : theAmens });
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
var spcs = [];
var theSpaces = response.getReturnValue();
console.log("the Spaces " + theSpaces);
for ( key in theSpaces ) {
spcs.push({value:theSpaces[key], key:key});
}
component.set("v.spaces", spcs);
}
});
$A.enqueueAction(action);
}
Has anyone else had a similar problem, and what is the solution?