【发布时间】:2017-10-05 22:46:17
【问题描述】:
我有一个函数
parseJobs(userId: string) {
this.getLikedJobs(userId).subscribe(result => {
result.map(key =>{
let rows = {
name : (key as any).jobsUser.firstName,
jobType: 'Liked'
}
let job = {...rows,...(key as any).jobPosting};
this.result.push(job);
});
});
this.getSavedJobs(userId).subscribe(result => {
result.map(key =>{
let rows = {
name : (key as any).jobsUser.firstName,
jobType: 'Saved'
}
let job = {...rows,...(key as any).jobPosting};
this.result.push(job);
});
});
return this.result;
}
如何将结果返回到promise,我尽力了,但我不知道该怎么做,可能是因为我有两个observable,
【问题讨论】:
-
你使用 Reactive-Extensions (RxJS) 库吗?
-
是的,我正在使用
标签: javascript typescript promise es6-promise