簡體   English   中英

預期有 2 個參數,但在 angular build prod 中得到 1 個參數

[英]Expected 2 arguments , but got 1 in angular build prod

如果我正常提供我的 angular 應用程序,它可以工作,但是如果我嘗試在 prod 模式下提供服務,它會給我這個錯誤,我真的不知道問題出在哪里..

//error on build: Expected 2 arguments, but got 1.

<ion-col class="ion-no-padding" size-md="12" size-lg="12" size-sm="12" size-xs="12" 
*ngFor="let i=index; let post of person$ | async | sortPipe">

頁面.ts

 //vars;
  personSubject = new ReplaySubject<any>(1);
  person$: Observable<any> = this.personSubject.asObservable();
  private destroy$ = new Subject();

 getAllPosts() {
    this.authService.getAllPosts().pipe(takeUntil(this.destroy$)).subscribe((res: any) => {

      const lenght = res.length;
      console.log(lenght);

      this.getFullPosts = res.data.post;
      this.personSubject.next(res.data.post)
      this.userGallery = res.data.post.forEach(img => {
        img.galleryImages = img.images.map(image => {
          return new ImageItem({ src: image, thumb: image });
        });

      

      })
    });

解決了!

我沒有在SortPipe聲明所有屬性。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM