17 lines
549 B
TypeScript
17 lines
549 B
TypeScript
import { Injectable } from "@angular/core";
|
|
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
|
import { Observable } from "rxjs";
|
|
|
|
@Injectable({
|
|
providedIn: "root",
|
|
})
|
|
export class BuildingService {
|
|
constructor(private http: HttpClient) {}
|
|
|
|
getBuildingData(page: number = 1, limit: number = 10): Observable<any> {
|
|
const url = `http://167.86.72.99:3100/building?page=${page}&limit=${limit}`;
|
|
const headers = new HttpHeaders().set('Content-Type', 'application/json');
|
|
return this.http.get<any>(url, { headers });
|
|
}
|
|
}
|