25 lines
574 B
TypeScript
25 lines
574 B
TypeScript
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<Positions>{
|
|
return this.http.post<Positions>(assetUrl, asset) ;
|
|
}
|
|
|
|
}
|
|
|