Load applications from api.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-application-button',
|
||||
template: `
|
||||
<button class="secondaryy" type="button" matTooltip="Add a new application to monitor">
|
||||
<mat-icon>add</mat-icon>
|
||||
Add
|
||||
</button>
|
||||
`
|
||||
})
|
||||
export class AddApplicationButtonComponent {
|
||||
|
||||
}
|
||||
@@ -11,6 +11,10 @@ export class ApplicationService {
|
||||
private _httpClient: HttpClient
|
||||
) {}
|
||||
|
||||
getAll(): Promise<Application[]> {
|
||||
return this._httpClient.get<Application[]>('/api/applications').toPromise();
|
||||
}
|
||||
|
||||
add(application: Application): Promise<Application> {
|
||||
return this._httpClient.post<Application>('/api/applications', application).toPromise();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user