In my Angular 5 application, I am trying to interact with an API using a service. I have a method that is intended for posting data to the API. However, when I specify the type of the post method as "Candidate" object, I receive the following warning:
src/app/candidates.service.ts(17,12): error TS2558: Expected 0 type arguments, but got 1.
Here is the code for my function:
addCandidate(candidate: Candidate): Observable<Candidate> {
return this.http.post<Candidate>(this.apiUrl, candidate, httpOptions);}
I suspect that I may be misusing types in this code snippet, but I am uncertain.