Skip to content

Instantly share code, notes, and snippets.

@4skinSkywalker
Last active March 28, 2019 10:38
Show Gist options
  • Save 4skinSkywalker/f4b4342cb1a5357f85ae38e527ecc2b5 to your computer and use it in GitHub Desktop.
Save 4skinSkywalker/f4b4342cb1a5357f85ae38e527ecc2b5 to your computer and use it in GitHub Desktop.
@Injectable()
export class CustomersService {
constructor(
private http: Http) { }
getAll() {
return this.http.get('api/customers')
.subscribe(customers => {
console.log(customers)
})
}
get(id) {
return this.http.get(`api/customers/${id}`)
.subscribe(customer => {
console.log(customer)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment