-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TreeNode: data is no longer generic #13183
Comments
Broken in commit d3b00fc. I was quite surprised of this breaking change in the public API because virtually no breaking changes was documented |
There is similar breaking change in cascade select control where now you can only bind any[] and not specific type as before. |
Confirmed, had to switch all of ours to the non-generic version to get it to compile. |
👏 |
The data attribute is still type any, the generic value is not being passed on. |
The bug still exists in version 16.0.2. |
@gerbermichi does it fail in compile time? My experience is that compilation failed in v16.0.1 but passed successfully in v16.0.2. |
It doesn't compile. https://github.com/primefaces/primeng/blob/master/src/app/components/api/treenode.ts export interface TreeNode<T = any> {
/**
* Label of the node.
*/
label?: string;
/**
* Data represented by the node.
*/
data?: any;
|
My app compiles and seems to behave as expected. But you are right, should be |
Also can't compile after updating. could this be reopened? |
👍 |
* feat: Add custom style class to p-table/p-dataview/p-treeview * fix(primeng/p-button): spinner style not working propely Fixes #13148. * Fixed #13183 - Make TreeNode generic * Fix: Icon list visibility * fix(primeng/p-menu): render html via `DomSanitizer` Fixes #13128. * fix(primeng/p-button): not working `loadingIcon` property, update loadingdoc example Fixes #13098. * fix: update angular version restriction * fix(primeng/p-confirmDialog): not updated style in runtime Fixes #13155. * Fix #13129 - FileUpload | File limit does not fire error * Fix #13201 - OverlayPanel: Incorrect position when inside of dialog in 16.0.0 (did not happen in rc2) * Fix - Surface color list * fix #13124 --------- Co-authored-by: Egor Volvachev <axe.onegaimy@gmail.com> Co-authored-by: Çetin <69278826+cetincakiroglu@users.noreply.github.com> Co-authored-by: gucal <gucalaliriza@outlook.com> Co-authored-by: Olivier Barais <olivieR.barais@gmail.com>
Describe the bug
The data attribute of TreeNode is now type
any
, which breaks the previous implementation of passing in a generic<T>
value for data.https://github.com/primefaces/primeng/blob/master/src/app/components/api/treenode.ts
The TreeNode would now probably have to be defined as something like
TreeNode & { data?: T }
, which is not ideal.Here is what it used to be:
https://github.com/primefaces/primeng/blob/14.2.3/src/app/components/api/treenode.ts
Environment
Angular 16
PrimeNG 16
Reproducer
No response
Angular version
16.0.0
PrimeNG version
16.0.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
TreeNode should accept a generic data type instead of any
The text was updated successfully, but these errors were encountered: