Skip to content

Instantly share code, notes, and snippets.

@firminochangani
Created May 27, 2018 12:56
Show Gist options
  • Save firminochangani/a47cf67447788be4231048bd7c5fb393 to your computer and use it in GitHub Desktop.
Save firminochangani/a47cf67447788be4231048bd7c5fb393 to your computer and use it in GitHub Desktop.
created() {
const API_POSTS = 'https://jsonplaceholder.typicode.com/posts';
fetch(API_POSTS, {method: 'GET'})
.then(res => res.json())
.then(json => {
this.posts = json;
/* Set loading to false after the content
is ready to be displayed */
this.loading = false;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment