Skip to content

fix(material/table): correct filterPredicate typo #26902

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

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/material/legacy-table/table-data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {_MatTableDataSource} from '@angular/material/table';
* sorting (using MatSort), and pagination (using paginator).
*
* Allows for sort customization by overriding sortingDataAccessor, which defines how data
* properties are accessed. Also allows for filter customization by overriding filterTermAccessor,
* properties are accessed. Also allows for filter customization by overriding filterPredicate,
* which defines how row data is converted to a string for filter matching.
*
* **Note:** This class is meant to be a simple data source to help you get started. As such
Expand Down
6 changes: 3 additions & 3 deletions src/material/table/table-data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ export class _MatTableDataSource<

/**
* Returns a filtered data array where each filter object contains the filter string within
* the result of the filterTermAccessor function. If no filter is set, returns the data array
* the result of the filterPredicate function. If no filter is set, returns the data array
* as provided.
*/
_filterData(data: T[]) {
// If there is a filter string, filter out data that does not contain it.
// Each data object is converted to a string using the function defined by filterTermAccessor.
// Each data object is converted to a string using the function defined by filterPredicate.
// May be overridden for customization.
this.filteredData =
this.filter == null || this.filter === ''
Expand Down Expand Up @@ -414,7 +414,7 @@ export class _MatTableDataSource<
* sorting (using MatSort), and pagination (using MatPaginator).
*
* Allows for sort customization by overriding sortingDataAccessor, which defines how data
* properties are accessed. Also allows for filter customization by overriding filterTermAccessor,
* properties are accessed. Also allows for filter customization by overriding filterPredicate,
* which defines how row data is converted to a string for filter matching.
*
* **Note:** This class is meant to be a simple data source to help you get started. As such
Expand Down