source: Sources/frontend/src/app/category.service.ts

Last change on this file was 8423429, checked in by AngelNasev <angel.nasev@…>, 17 months ago

Add backend and frontend projects

  • Property mode set to 100644
File size: 474 bytes
Line 
1import { Injectable } from '@angular/core';
2import {HttpClient} from "@angular/common/http";
3import {Observable} from "rxjs";
4import {CategoryInterface} from "./categoryInterface";
5
6@Injectable({
7 providedIn: 'root'
8})
9export class CategoryService {
10
11 url = "http://localhost:8080/api/categories"
12
13 constructor(private http: HttpClient) {
14 }
15
16 getAllCategories(): Observable<CategoryInterface[]> {
17 return this.http.get<CategoryInterface[]>(`${this.url}/all`)
18 }
19}
Note: See TracBrowser for help on using the repository browser.