import { Injectable } from "@angular/core"; import { Api } from "./api"; import { IRslt, TaxTable, BankAccount, Account } from "../../public-api"; import { Observable } from "rxjs"; @Injectable({ providedIn: 'root' }) export class BankService { get route() { return this.api.base + 'bankaccount' } constructor(private api: Api) { } getByID(id:string): Observable> { return this.api.get(this.route + '/' + id) } post(bank: BankAccount): Observable> { return this.api.post(this.route, bank) } put(bank: BankAccount): Observable> { return this.api.put(this.route, bank) } delete(bank: BankAccount): Observable> { return this.api.delete(this.route + '/' + bank._id); } }