Primeng: Support Angular 8

Created on 3 May 2019  路  12Comments  路  Source: primefaces/primeng

Issue #7306 has been closed, now I'm going to submit the same issue. The difference is that when the person reported this issue, Angular 8 was a beta version.
As right now we are at RC2, I think it makes sense to fix this issue.
However, there is another reason to fix the issue, independently to support or not support Angular 8: the import statement is simply wrong.

The problem resides in the TableComponent (table.ts).

I already tested the built package with an Angular 7 & Angular 8 application and I can confirm that it works.

enhancement

Most helpful comment

@JaePhoenix
Adding an alias in tsconfig.json might help.

    "paths": {
      "@angular/core/src/metadata/*": ["./node_modules/@angular/core"]
    },

All 12 comments

Hi.
Can we please get a new release for this feature?

I think they will publish the release 8.0.0, when those issues are fixed/implemented https://github.com/primefaces/primeng/milestone/116

Understandable. Thanks.

@JaePhoenix
Adding an alias in tsconfig.json might help.

    "paths": {
      "@angular/core/src/metadata/*": ["./node_modules/@angular/core"]
    },

Please see;

7761

@cagataycivici What about fixing this in 7.1.3 and publishing 7.1.4. This way we can migrate to Angular 8 right now and not wait until PrimeNg 8.0 is out?

@dmytro-gokun LOL, I don鈥檛 understand, the import statement is simply wrong, regardless of Angular 7/8... imho this should be fixed and then we can wait for the upgraded version with full Angular 8/Ivy Compiler support

@JaePhoenix
Adding an alias in tsconfig.json might help.

    "paths": {
      "@angular/core/src/metadata/*": ["./node_modules/@angular/core"]
    },

this is fixed my issue but with ../node , Thanks

@JaePhoenix
Adding an alias in tsconfig.json might help.

    "paths": {
      "@angular/core/src/metadata/*": ["./node_modules/@angular/core"]
    },

this is fixed my issue but with ../node , Thanks

Make sure you remove the same after PrimeNG 8 or a version with corrected import becomes available.
Another possible option would be to point packae.json to primeng#master as this is fixed in master.

There is a simple workaround i've come with:

in package.json

"scripts": {
    "postinstall": "bash ./dev-tools/patch-ngprime-for-ivy.sh && ivy-ngcc",
cat dev-tools/patch-ngprime-for-ivy.sh
#!/bin/bash

#Replace an invalid import
sed -i 's/\@angular\/core\/src\/metadata\/lifecycle_hooks/\@angular\/core/' node_modules/primeng/components/table/table.d.ts

@igorgiovannini When will PrimeNG suppose to support Ivy mode?

@sergey-morenets

@igorgiovannini When will PrimeNG suppose to support Ivy mode?

I don't know, honestly I didn't yet updated to PrimeNG 8. I needed only the table, so I copied and fixed the code in my project in order to get this part working with Ivy Renderer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cagataycivici picture cagataycivici  路  31Comments

agusdutra picture agusdutra  路  52Comments

danielkay picture danielkay  路  39Comments

ammar91 picture ammar91  路  40Comments

danny-swimmer picture danny-swimmer  路  39Comments