如何获取服务代码?我尝试下面的代码,但它没有记录任何内容。
在 service.ts 文件中。
constructor(private http: HttpClient) { }
postForgotPass(email): Observable<Response> {
return this.http.post<Response>(envi.apiUrl +'/user/forgotpassword', {
"email": email,
"headers": headers,
observe: 'response'
})
}
Run Code Online (Sandbox Code Playgroud)
在我的 component.ts 文件中
sendForgotPass() {
return this.service.postForgotPass(this.emailFormControl.value)
.subscribe(
res => {
console.log(res.status);
})
}
Run Code Online (Sandbox Code Playgroud)