![](/img/trans.png)
[英]Angular attribute directive - error on prod build expected 1 arguments but got 0
[英]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.