Skip to content

Instantly share code, notes, and snippets.

@xgeek-net
Created January 6, 2019 07:23
Show Gist options
  • Save xgeek-net/7f6b4589018179a582acd1241e232d15 to your computer and use it in GitHub Desktop.
Save xgeek-net/7f6b4589018179a582acd1241e232d15 to your computer and use it in GitHub Desktop.
SampleAuraController.js Lightning Component
({
'showAccount' : function(cmp, ev, helper) {
var params = { accountId : '001xxxxxxxxxxxx' }; // your parameters
helper.sendRequest(cmp, 'c.firstRequest', params)
.then($A.getCallback(function(records) {
console.log('First From Server-Side: ' + records);
return helper.sendRequest(cmp, 'c.secondRequest', params);
}))
.then($A.getCallback(function(records) {
console.log('Second From Server-Side: ' + records);
}))
.catch(function(errors) {
console.error('ERROR: ' + errors);
});
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment