Skip to main content
added 10 characters in body
Source Link
sfdcfox
  • 501.8k
  • 21
  • 473
  • 828

Your callback has an empty function body, because the second parentheses closes the function body prematurely. Honestly, I'm surprised this compiled at all. It should look more like:

getMyContacts : function(cmp) {
    var action = cmp.get("c.getContacts");
    action.setCallback(this,function(response) {
        var status = response.getStatus();
        if(status === "SUCCESS"){
            cmp.set("v.contacts", response.getReturnValue());
        }
    }));
}

Your callback has an empty function body, because the second parentheses closes the function body prematurely. Honestly, I'm surprised this compiled at all. It should look more like:

getMyContacts : function(cmp) {
    var action = cmp.get("c.getContacts");
    action.setCallback(this,function(response) {
        var status = response.getStatus();
        if(status === "SUCCESS"){
            cmp.set("v.contacts", response.getReturnValue());
        }
}));

Your callback has an empty function body, because the second parentheses closes the function body prematurely. Honestly, I'm surprised this compiled at all. It should look more like:

getMyContacts : function(cmp) {
    var action = cmp.get("c.getContacts");
    action.setCallback(this,function(response) {
        var status = response.getStatus();
        if(status === "SUCCESS"){
            cmp.set("v.contacts", response.getReturnValue());
        }
    });
}
Source Link
sfdcfox
  • 501.8k
  • 21
  • 473
  • 828

Your callback has an empty function body, because the second parentheses closes the function body prematurely. Honestly, I'm surprised this compiled at all. It should look more like:

getMyContacts : function(cmp) {
    var action = cmp.get("c.getContacts");
    action.setCallback(this,function(response) {
        var status = response.getStatus();
        if(status === "SUCCESS"){
            cmp.set("v.contacts", response.getReturnValue());
        }
}));