Subject.forkJoin不是一个功能

时间:2017-07-24 13:29:53

标签: angular rxjs

我收到此错误" WEBPACK_IMPORTED_MODULE_1_rxjs_Rx .Subject.forkJoin不是函数"当对一个主题使用forkJoin时,对我做错了什么的任何建议?

import { Subject } from 'rxjs/Rx';

uploadImages(imgsToUpload: File[]): Subject<void> {
    let subjImgs: Subject<void>[] = [];
    let subj: Subject<void> = new Subject<void>();

    if (imgsToUpload && imgsToUpload.length > 0) {
      imgsToUpload.forEach(img => {
        subjImgs.push(this.mediaResourceService.uploadFile(img));
      });
      Subject.forkJoin(subjImgs).subscribe(x => subj.next());
    } else {
      subj.next();
    }
    return subj;
  }

0 个答案:

没有答案