-
-
Save martinandersen3d/02127425a70311fe27f4ec90dbf91cb4 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