ngx-pagination
                                
                                 ngx-pagination copied to clipboard
                                
                                    ngx-pagination copied to clipboard
                            
                            
                            
                        Does not work with IVY
=======
Angular version: 8.0.0
ngx-pagination version: 4.0.0
Description of issue: When using NGX-Pagination with IVY turned on you get the following error:
ERROR Error: Export of name 'paginationApi' not found! at cacheMatchingLocalNames (core.js:12842) at resolveDirectives (core.js:12616) at createDirectivesAndLocals (core.js:12058) at ɵɵelementStart (core.js:15324) at PaginationControlsComponent_Template (template.html:2) at executeTemplate (core.js:11982) at checkView (core.js:13333) at componentRefresh (core.js:13097) at refreshChildComponents (core.js:11685) at refreshDescendantViews (core.js:11591)
Steps to reproduce:
- Create a new Angular 8.0.0 project
- Enable IVY by adding
"angularCompilerOptions": { "enableIvy": true },to the tsconfig.app.json file
- Install the package and create the sample project as seen in the readme
- Load the page
Expected result: Error is not produced and the module works
Actual result: Error message is displayed in the console and the page does not load
Thanks for the report. As far as I understand, Ivy should be completely backwards-compatible.
We’ll be using the opt-in preview of Ivy in 8.0.0 to validate our promises about backwards compatibility and to work on any automated migration tools we might need. (source: https://blog.angular.io/a-plan-for-version-8-0-and-ivy-b3318dfc19f7)
So perhaps this has uncovered a bug in the ivy backwards-compatibility.
If we look through this thread https://github.com/angular/angular/issues/21706#issuecomment-497388916 then it seems that issues with 3rd party libs are not uncommon with the current implementation of the Ivy preview.
Rather than try to make fixes in this lib against a moving target, I'd rather flag up this issue to the Angular team as a possible example where Ivy is not yet backwards compatible.
Flagging it up via twitter: https://twitter.com/michlbrmly/status/1149604969407844354
Right, so Stephen Fluin from the Angular team just said to open a new issue on the Angular repo.
I've not got time right at the moment to put one together including testing the reporduction etc.
If anyone wants to do it (@hadley8899 ?) then just be sure to link back to this issue so we can track it.
I have created an issue on the official repo
https://github.com/angular/angular/issues/31540
Also created a basic repo for reproduction
https://github.com/hadley8899/angular-ngx-pagination-ivy-issue
@hadley8899 thanks, and 💯 quick response from the Angular team!
Should be working in 9.0.0-next.2.