Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created April 5, 2020 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/b5c2e294ef6b22fb9725cb7bf1afb8aa to your computer and use it in GitHub Desktop.
Save arun12209/b5c2e294ef6b22fb9725cb7bf1afb8aa to your computer and use it in GitHub Desktop.
Covid19_NewsHelper
({
fetchNewsData : function(component, event, helper) {
var action=component.get("c.fetchNews");
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
var result = JSON.parse(JSON.stringify(response.getReturnValue()));
component.set('v.newsData',result.articles);
console.log('Articles = '+JSON.stringify(result.articles));
//console.log(' Result : ' +JSON.stringify(result.articles[0].title));
}
});
$A.enqueueAction(action);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment