Last active
September 25, 2019 14:48
-
-
Save ganqqwerty/316775e6420cae4e1d8ca1f044105e22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { HttpClient, HttpParams } from '@angular/common/http'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ProductService { | |
private readonly URL = 'https://world.openfoodfacts.org/api/v0/product/'; | |
constructor(private http: HttpClient) { | |
} | |
resolveProduct(code: string): Observable<any> { | |
console.log('Request is sent!') | |
return this.http.get(this.URL+code+'.json'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment