简体   繁体   中英

i am getting error when i use jw-pagination or ngx-pagination…I am using angular 9.1.1

jw-pagination

ERROR in src/app/app.module.ts:49:5 - error NG6001: Cannot declare 'JwPaginationComponent' in an NgModule as it's not a part of the current compilation.

ngx-pagiation

ERROR in src/app/app.module.ts:49:5 - error NG6001: Cannot declare 'NgxPaginationModule' in an NgModule as it's not a part of the current compilation.

You can't declare anything in the declarations (in @NgModule of app.module.ts file) if you don't have it in your app.

So,

  1. Just remove the declaration of 'JwPaginationComponent' or 'NgxPaginationModule' from the @NgModule of app.module.ts file.
  2. and add 'JwPaginationComponent' or 'NgxPaginationModule' in the imports (in @NgModule of app.module.ts file) .

Now try ng serve, it should work fine...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM