0
votes

I am working on adding pagination in my API result. For this I have install "Ng2-pagination", form this url "https://www.npmjs.com/package/ng2-paginate", But whenever I hit npm start, It's gives me following error.

app/blog.component.ts(6,23): error TS2305: Module '"/var/www/html/test/ng/node_modules/ng2-pagination/index"' has no exported member 'PaginationControlsCmp'.

app/blog.component.ts(13,3): error TS2345: Argument of type '{ selector: string; templateUrl: string; providers: (typeof PageService | typeof PaginationServic...' is not assignable to parameter of type 'Component'. Object literal may only specify known properties, and 'directives' does not exist in type 'Component'.

1
show code of blog.component.ts. Also from error 'directives' does not exist in type 'Component'. it look like you are using directives in @Component decorator which is deprecated now - ranakrunal9
i think you have to try github.com/michaelbromley/ng2-pagination and follow the guide for it - ranakrunal9
"pastebin.com/DUVc6s9E" my blog code. - HKumar
I have tried that documentation but it's giving me again error "unsee.cc/gedobizu" - HKumar

1 Answers

0
votes

In latest Angular release directives and pipes are deprecated on @Component metadata. You have to provide your all directives and pipes inside declarations metadata of your @NgModule metadata.

So as per simple-example of ng2 pagination you have to import Ng2PaginationModule inside yout AppModule.

You can check documentation for more detail about NgModule.