// Calling a server-side action
({
callServerSideAction : function(cmp) {
// 1. Retrieve an action object by specifying the
// Apex method that will be called
let action = cmp.get("c.myApexEndpoint");
// 2. Optionally set some action parameters
action.setParams({ firstName : cmp.get("v.firstName") });
// 3. Configure a callback function that will be
// executed to handle the server response
action.setCallback(this, function(response) {
// Some response processing code
});
// 4. Optionally set some action configuration flags
// 5. Enqueue the action so that the framework processes it
$A.enqueueAction(action);
}
})
0 Comments