Example #1
0
	getPlanets(): Observable<Planet[]> {
		return this.http.get('http://swapi.co/api/planets/')
			.map(this.extractData)
			.catch(this.handleError)
	}
	getComentariosEvento(id:number){
		return this.http.get(URL+id)
	      .map(response => response.json())
	      .catch(error => this.handleError(error));
	}
Example #3
0
 getBooks(): Observable<any> {
     return this.http.get(this.baseUrl).map(response => response.json());
 }
Example #4
0
 get_req(url: string, options?: Object) : any {
     var url = this.query(url, options);
     return this.http.get(url)
       .map((res: Response) => res.json());
 }
Example #5
0
 insert(doc) : any {
     return this.http.post("/contacts", JSON.stringify(doc))
         .map((res: Response) => res.json());
 }
Example #6
0
	GetMatches()
	{
		return this.http.get('/rest/match');
	}
 getResume(){
     return this._http.get("http://api.steve-botello.com/resume").map(r => r.json())
 }
 updateItem(item:Item) {
     this.http.put(`${BASE_URL}${item.id}`, JSON.stringify(item), HEADER)
         .subscribe(action => this.store.dispatch({type: 'UPDATE_ITEM', payload: item}));
 }
 deleteItem(item:Item) {
     this.http.delete(`${BASE_URL}${item.id}`)
         .subscribe(action => this.store.dispatch({type: 'DELETE_ITEM', payload: item}));
 }
 loadAllItems() {
     this.http.get(BASE_URL)
         .map(res => res.json())
         .map(payload => ({type: 'ADD_ITEMS', payload}))
         .subscribe(action => this.store.dispatch(action));
 }