Skip to content

Instantly share code, notes, and snippets.

@ByJC
Created January 26, 2017 12:42
Show Gist options
  • Save ByJC/418503dc47d7d195696fc3f2a30e02d3 to your computer and use it in GitHub Desktop.
Save ByJC/418503dc47d7d195696fc3f2a30e02d3 to your computer and use it in GitHub Desktop.
import { Http } from '@angular/http';
import { Injectable } from '@angular/core';
@Injectable ()
export class ExampleService {
constructor(public http: Http) {}
getDataA() {
return this.http.get('http://www.server.com/dataA').map(res => res.json());
}
getDataB() {
return this.http.get('http://www.server.com/dataB').map(res => res.json());
}
getDataC() {
return this.http.get('http://www.server.com/dataC').map(res => res.json());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment