import { Injectable } from '@angular/core'; import { HttpClient,HttpErrorResponse } from '@angular/common/http'; import { Asset, Positions } from '../asset'; import { Observable } from 'rxjs'; let assetUrl: string ='https://api.arti24.eu/rest-api/assets/calculate'; //let assetUrl: string ='http://localhost:8801/rest-api/assets/calculate'; @Injectable({ providedIn: 'root' }) export class AssetService { constructor(private http: HttpClient) { } calculate(asset: Asset) : Observable{ return this.http.post(assetUrl, asset) ; } }