属性' concatmap'在类型上不存在
请帮忙,我试图从Angular发送一个请求...当我尝试使用ConcatMap时,我会收到错误,
public updateUser(token: string, requestBody: any): Observable<User> {
const myHeaders = new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token });
return this.http.put<User>(this.baseUrl + "api/user", requestBody, { headers: myHeaders }).concatMap(data => {
return of(data);
});
}
会收到以下错误。
Property 'concatMap' does not exist on type 'Observable<User>'.
我 仍然相同的错误
import 'rxjs/add/operator/concatMap';
import { concatMap } from 'rxjs/operators';
Please help, i am trying to send a put request from Angular...when i try to use concatMap i get the error
public updateUser(token: string, requestBody: any): Observable<User> {
const myHeaders = new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + token });
return this.http.put<User>(this.baseUrl + "api/user", requestBody, { headers: myHeaders }).concatMap(data => {
return of(data);
});
}
I get the below error..please anyone knows what i am doing wrong
Property 'concatMap' does not exist on type 'Observable<User>'.
I have tried the following, nothing worked, still same error
import 'rxjs/add/operator/concatMap';
import { concatMap } from 'rxjs/operators';
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够通过将管道添加到我的代码中来解决此问题
}
I was able to solve this by adding pipe to my code
}