VadimDez / ngx-order-pipe

▼ Angular 5+ orderBy pipe
https://vadimdez.github.io/ngx-order-pipe/
MIT License
243 stars 57 forks source link

Error when using ngx-pipes with ngx-order-pipe (both packages contain orderBy pipe) #95

Closed anisabboud closed 3 years ago

anisabboud commented 4 years ago

Hi, I'm getting a new compiler error when using a comparator, after upgrading to Angular 9. (The error appears with "fullTemplateTypeCheck": true https://angular.io/guide/template-typecheck.)

src/app/navigation/abc/abc.component.html:39:78 - error TS2554: Expected 1-2 arguments, but got 5.

   <button *ngFor="let team of teams | async | values | orderBy: 'teamName' : false : false : comparator">

I guess the compiler doesn't like the " : " syntax. Update: Actually the " : " is correct.

The problem seems due to a pipe name conflict between two packages:

When I use orderBy, I mean to use your version (which takes multiple parameters), but seems like the template checker compiler is confusing it with the ngx-pipes version (which takes only 1 parameter).

I'm not sure what the best long-term solution is. Perhaps a merger between the two libraries above, or using different names/prefixes.

Short-term, I need to work-around this error by either disabling fullTemplateTypeCheck, or extending the pipe under a different name, or dropping one of the packages from my project.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.