I have an apex method which is returning map in the form of Map<string,Object> and map will contains only one record
Can anyone help me how can I set attribute on component from map value
On component, I have two string attributes string1 and string2
From Java script, I want to set
component.set('v.string1',map.field1)
component.set('v.string2',map.field2)
doInit : function(component, event, helper) {
//sai start
var action = component.get('c.showSearch');
action.setCallback(this, function(response) {
var state = response.getState();
if(state === 'SUCCESS') {
var result = response.getReturnValue();
component.set('v.searchHub', response.getReturnValue().Search_Hub_Name__c);
component.set('v.name2',response.getReturnValue().Visualforce_Component_Name__c);
} else {
console.log('Error: ' + response.getError());
}
});
Can anyone help on this please