michaelbromley / ngx-pagination

Pagination for Angular
http://michaelbromley.github.io/ngx-pagination/
MIT License
1.21k stars 244 forks source link

Library outdated #410

Open faraz-ahmad-uft opened 4 months ago

faraz-ahmad-uft commented 4 months ago

Has the author stopped supporting this library? Looks like it is not compatible with the latest Angular version.

michaelbromley commented 4 months ago

No, it is still maintained - I use it in several projects, some of which are on Angular v17. Which version are you having trouble with?

faraz-ahmad-uft commented 4 months ago

Thanks for the response.

I am using Angular v18.

michaelbromley commented 4 months ago

ok. please provide all relevant details of any errors you get with v18. I've not tested it yet.

godenji commented 2 months ago

Here's one that you'll hit when using standalone components:

The pipe 'PaginatePipe' appears in 'imports', but is not standalone and cannot be imported directly. It must be imported via an NgModulle

michaelbromley commented 2 months ago

@godenji thanks for the info.

So right now you just need to entire NgxPaginationModule to your imports array right? I am using this package successfully with standalone components in this way in a v17 app.

If anyone wants to make the necessary changes to make the lib compatible with standalone, please let me know. Otherwise I'll get around to it when I have time.

godenji commented 2 months ago

So right now you just need to entire NgxPaginationModule to your imports array right? I am using this package successfully with standalone components in this way in a v17 app.

Do you mean adding pagination module to importProvidersFrom of main.ts, or adding it to imports array of standalone component? If the latter, you cannot import a module within imports section of a standalone component.

Also, on Angular 18 here, so perhaps there are other changes at play; thus the title of this github issue :)

p.s. thank you for creating this useful library.

michaelbromley commented 2 months ago

From the angular.io components docs:

Standalone components can import other standalone components, directives, and pipes as well as existing NgModules.

Importing the module into your standalone component should work fine. I'm doing it with this lib on a production v17 app.

godenji commented 2 months ago

Ah, could be this that I'm hitting:

This property is only available for standalone components - specifying it for components declared in an NgModule generates a compilation error.

Looks like I need to fully migrate target route and all of its subcomponents to standalone first (I just attempted to convert pagination component in the hierarchy to standalone and import NgxPaginationModule in the imports array).

Hopefully it's as straightforward as that...

kumarl1 commented 2 months ago

@godenji:- Did you find any alternative solution for this? I am also facing some issue like yours?

kumarl1 commented 2 months ago

@michaelbromley : Are you planning to migrate it to the latest version(16/17) of the angular?

tanver-asthait commented 1 month ago

I have installed in my V18 app importing the NgxPaginationModule in my components import array, and it works fine, a small problem though as the new @for directive doesn't allow me to add paginate pipe alongside it. so I used the old ngFor directive and its working as expected.