primeng icon indicating copy to clipboard operation
primeng copied to clipboard

make primeng compatible with Angular strictTemplates mode

Open FabienDehopre opened this issue 3 years ago • 1 comments

I'm submitting a ... (check one with "x")

[ ] bug report => Search github for a similar issue or PR before submitting
[X] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior Actually, the optional properties of the components are not correctly typed (i.e.: property: string).

Expected behavior Optional properties should either be marked as such using the question mark (i.e.: property?: type). or have a default value set (i.e.: property: string = 'some value').

What is the motivation / use case for changing the behavior? This should (will) make the development of Angular application using the strictTemplates option way easier.

Please tell us about your environment: Windows 10

  • Angular version: 5.X Angular 13

  • PrimeNG version: 5.X PrimeNG 13

  • Language: TypeScript 4.5 / HTML

  • Node (for AoT issues): node --version = 14.17.6

FabienDehopre avatar Dec 23 '21 12:12 FabienDehopre

Is there any news?

I started using strictTemplates and since I use prime alot this problem occurs in many places.

My suggestion is that optional properties should not only be marked as such using the question mark (i.e.: minDate?: Date) but also be nullable (i.e.: minDate?: Date | null).

Further according to the documentaion some default values are null. In most cases this is wrong. It is undefined not null. Regardless of whether it is undefined or null, it should be possible to use the default value but that's not possible with strictTemplates.

Urtgard avatar Sep 15 '22 09:09 Urtgard

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

mertsincan avatar Nov 09 '22 20:11 mertsincan