How do I get the service code? I try the code below, but it does not log anything.
In a service.ts file.
constructor(private http: HttpClient) { }
postForgotPass(email): Observable<Response> {
return this.http.post<Response>(envi.apiUrl +'/user/forgotpassword', {
"email": email,
"headers": headers,
observe: 'response'
})
}
In my component.ts file
sendForgotPass() {
return this.service.postForgotPass(this.emailFormControl.value)
.subscribe(
res => {
console.log(res.status);
})
}
Observable<HttpResponse>
? – Brazil