I am new to the lightning component. I want to get two lists in the js controller how it's possible?
public class ContactListController {
@AuraEnabled
public static List<Contact> getContactlist(){
List<integer> listTwo=new list<integer>();
listTwo.add(1);
listTwo.add(4);
listTwo.add(9);
List<Contact> listOne= new List<Contact>([select id, FirstName,LastName,email,Phone from Contact]);
return listOne;
}
}
Js controller
({
doInit : function(component, event, helper) {
var action= component.get('c.getContactlist');
action.setCallback(this,
function(response){
var responseValue = response.getReturnValue();
component.set('v.contactlist',responseValue);
},'SUCCESS');
$A.enqueueAction(action,false)
}
})
Now Question is how can we get two lists in js controller. the getContactlist
return only one list. I want to return many things from the same method like integer , string, boolean etc