Created
September 2, 2017 16:34
-
-
Save pastranastevenaz/667c617e377ac27facc438dda98e301f to your computer and use it in GitHub Desktop.
Example of an axios get request using arrow functions
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
var albums = []; | |
axios.get('https://jsonplaceholder.typicode.com/albums') | |
.then(response =>{ | |
this.albums = response.data | |
}) | |
.catch(error =>{ | |
console.log(error); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you