Skip to content

Instantly share code, notes, and snippets.

@odhiambo123
Created September 15, 2022 04:30
Show Gist options
  • Save odhiambo123/00b1fdc42245feaef430ae562baec188 to your computer and use it in GitHub Desktop.
Save odhiambo123/00b1fdc42245feaef430ae562baec188 to your computer and use it in GitHub Desktop.
adding products
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from "rxjs";
@Injectable({
providedIn: 'root'
})
export class DataService {
BASE_URL = 'https://apolis-grocery.herokuapp.com/api'
constructor(private http: HttpClient) { }
getCategories(): Observable<any> {
return this.http.get<any>(`${this.BASE_URL}/category`)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment