【发布时间】:2018-01-08 11:54:08
【问题描述】:
我的第一个帖子请求看起来像
this.http.post('http://localhost:8080/api/userfilm/get/', {
name: this.name })
然后他返回具有名为filmid 的属性的对象数组。我的第二个帖子请求看起来像
this.http.post('http://localhost:8080/api/post/get/', {
filmid: film.filmid })
我真的不知道我该如何一一做到这一点。例如
getAllPosts() {
return this.http.post('http://localhost:8080/api/userfilm/get/',
{ name: this.name })
.flatMap((film: any) =>
this.http.post('http://localhost:8080/api/post/get/',
{ filmid: film.filmid }))
}
this.getAllPosts().subscribe(response => {
console.log(response);
})
但这不是正确返回
【问题讨论】:
标签: javascript angular typescript ionic3