import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class ServicesService { private baseUrl = 'https://your-api-url.com/api'; // Set your base URL constructor(private http: HttpClient) {} // 🔹 GET get(endpoint: string): Observable { return this.http.get(`${this.baseUrl}/${endpoint}`); } // 🔹 POST post(endpoint: string, data: any): Observable { return this.http.post(`${this.baseUrl}/${endpoint}`, data); } // 🔹 PUT put(endpoint: string, data: any): Observable { return this.http.put(`${this.baseUrl}/${endpoint}`, data); } // 🔹 DELETE delete(endpoint: string): Observable { return this.http.delete(`${this.baseUrl}/${endpoint}`); } }