Created
April 5, 2020 08:33
-
-
Save arun12209/b5c2e294ef6b22fb9725cb7bf1afb8aa to your computer and use it in GitHub Desktop.
Covid19_NewsHelper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
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