Table/TreeTable: filters property might have undefined value when access by key #12321
Labels
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone
Describe the bug
In current version of Table and TreeTable there is a property
filters
which are declared asprimeng/src/app/components/treetable/treetable.ts
Line 280 in 40b29df
primeng/src/app/components/table/table.ts
Line 314 in 40b29df
this means any index key value will always return a non-null value, which is of course not right, it's a js object, when accessed with non-exists key, it will definitely return a
undefined
value.So angular 13/14/15, will create this warning when I write
dt.filters['closed']?.value === true
:So these declaration is wrong, it should include type of undefined.
Environment
don't need an enviroment
Reproducer
No response
Angular version
any version with strict mode on
PrimeNG version
any
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.2.1
Browser(s)
Edge 107
Steps to reproduce the behavior
No response
Expected behavior
these filters should include undefined value in type declaration.
The text was updated successfully, but these errors were encountered: