import {MatSortModule} from '@angular/material/sort';
MatSortHeaderIntl
To modify the labels and text displayed, create a new instance of MatSortHeaderIntl and include it in a custom provider.
Name | Description |
---|---|
|
Stream that emits whenever the labels here are changed. Use this to notify components if the labels have changed after initialization. |
|
ARIA label for the sorting button. |
MatSortHeader
Applies sorting behavior (click to change sort) and styles to an element, including an arrow to display the current sort direction.
Must be provided with an id and contained within a parent MatSort directive.
If used on header cells in a CdkTable, it will automatically default its id from its containing column definition.
Selector: [mat-sort-header]
Exported as: matSortHeaderName | Description |
---|---|
@Input()
|
Sets the position of the arrow that displays when sorted. |
@Input()
|
Overrides the disable clear value of the containing MatSort for this MatSortable. |
@Input()
|
Whether the component is disabled. |
@Input('mat-sort-header')
|
ID of this sort header. If used within the context of a CdkColumnDef, this will default to the column's name. |
@Input()
|
Overrides the sort start value of the containing MatSort for this MatSortable. |
MatSort
Container for MatSortables to manage the sort state and provide default sort parameters.
Selector: [matSort]
Exported as: matSortName | Description |
---|---|
@Input('matSortActive')
|
The id of the most recently sorted MatSortable. |
@Input('matSortDirection')
|
The sort direction of the currently active MatSortable. |
@Input('matSortDisableClear')
|
Whether to disable the user from clearing the sort by finishing the sort direction cycle. May be overriden by the MatSortable's disable clear input. |
@Input( matSortDisabled)
|
Whether the component is disabled. |
@Input('matSortStart')
|
The direction to set when an MatSortable is initially sorted. May be overriden by the MatSortable's sort start. |
@Output('matSortChange')
|
Event emitted when the user changes either the active sort or sort direction. |
|
Stream that emits once during the directive/component's ngOnInit. |
|
Collection of all registered sortables that this directive manages. |
deregister | |
---|---|
Unregister function to be used by the contained MatSortables. Removes the MatSortable from the collection of contained MatSortables. |
|
Parameters | |
sortable MatSortable
|
|
getNextSortDirection | |
---|---|
Returns the next sort direction of the active sortable, checking for potential overrides. |
|
Parameters | |
sortable MatSortable
|
|
Returns | |
SortDirection
|
|
register | |
---|---|
Register function to be used by the contained MatSortables. Adds the MatSortable to the collection of MatSortables. |
|
Parameters | |
sortable MatSortable
|
|
sort | |
---|---|
Sets the active sort id and determines the new sort direction. |
|
Parameters | |
sortable MatSortable
|
|
MatSortable
Interface for a directive that holds sorting state consumed by MatSortHeader
.
Name | Description |
---|---|
|
Whether to disable clearing the sorting state. |
|
The id of the column being sorted. |
|
Starting sort direction. |
Sort
The current sort state.
Name | Description |
---|---|
|
The id of the column being sorted. |
|
The sort direction. |
SortDirection
type SortDirection = 'asc' | 'desc' | '';