projecte_ionic_entrega_02/src/app/api.service.ts

23 lines
513 B
TypeScript

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class ApiService {
constructor(
public http: HttpClient
) { }
addCountry(data) {
return this.http.post('http://localhost/backend/insert_old.php', data);
}
getCountries() {
return this.http.get('http://localhost/backend/read.php');
}
delCountry(countryId) {
return this.http.post('http://localhost/backend/delete.php', countryId);
}
}