Skip to content

Instantly share code, notes, and snippets.

@gpincheiraa
Last active September 22, 2017 04:04
Show Gist options
  • Save gpincheiraa/bf6b44e647b104b73fc62fa952403e78 to your computer and use it in GitHub Desktop.
Save gpincheiraa/bf6b44e647b104b73fc62fa952403e78 to your computer and use it in GitHub Desktop.
TodoService_1.js
export class TodoService {
constructor($http, BASE_URL) {
this.http = $http;
this.url = `${BASE_URL}/todos`
}
getTodos() {
return this.http.get(this.url)
.then(res => res.data.todos)
.catch(error => error.message)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment