import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class BcacHttpService { constructor( private httpClient: HttpClient, ) { } accessInterface(url: string, method: string, token: any, param: any) { switch (method) { case "get": return this.httpClient.get(url, token); case "post": return this.httpClient.post(url, param, token); default: return this.httpClient.get(url, token); } } }