20 lines
645 B
TypeScript
20 lines
645 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable, of } from 'rxjs';
|
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
|
|
import { MessageService } from './message.service';
|
|
import { serviceBaseUrl } from './config';
|
|
import { TestOutput } from './testOutput';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class TestOutputService {
|
|
constructor(private messageService: MessageService, private http: HttpClient) { }
|
|
|
|
async getTestOutput(): Promise<TestOutput> {
|
|
this.messageService.add(`TestOutputService: fetch test output`);
|
|
return this.http.get<TestOutput>(`${serviceBaseUrl}/v1/test`).toPromise()
|
|
}
|
|
}
|