WIP
This commit is contained in:
19
src/app/candidate-data.service.ts
Normal file
19
src/app/candidate-data.service.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CandidateDataService {
|
||||
httpClient = inject(HttpClient)
|
||||
|
||||
response: any | null = null;
|
||||
error: any | null = null;
|
||||
|
||||
sendRequest() {
|
||||
this.httpClient.get('http://localhost:3000/app/candidates').subscribe({
|
||||
next: (res) => this.response = JSON.stringify(res),
|
||||
error: err => this.error = JSON.stringify(err)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user