ngx-pagination: Problem when working with AOT
Hi, thanks for contributing!
This project is maintained in my spare time, so in order to help me address your issue as quickly as possible, please provide as much of the following information as you can.
– Michael
Angular 2 version: rc.7 ng2-pagination version: latest Description of issue: Error when using AOT compiler Steps to reproduce: see above Expected result:
Actual result: Error: Unexpected value ‘Ng2PaginationModule’ imported by the module ‘SparepartM odule’ Demo: (if possible, edit this Plunker demo and paste the link to your fork)
Any relevant code:
import { Ng2PaginationModule } from 'ng2-pagination';
imports: [
SharedModule,
PalipediaDocumentModule,
Ng2PaginationModule,
ngc -p src
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 22 (9 by maintainers)
Created pull request #80 to resolve this. Tested with my AOT setup and the resulting build works.
@HristoKolev thanks for the detailed description there. I’ll get around to this next week probably.
I was having the same problem, but I was able to solve it by updating the commonJS plugin in my rollup config to have the following namedExport: ‘node_modules/ng2-pagination/index.js’: [‘Ng2PaginationModule’]
That fixed the issue for me.
@noemi-salaun you are totally correct, I forgot to add that. Will fix and issue new release.
When compiling with AOT, I get import errors for the
PaginationControlsDirective
.When I re-run ngc a second time, it works.
I think maybe it’s because you do not export
PaginationControlsDirective
.In src/ng2-pagination.ts