Sets the active sort id and determines the new sort direction.
(sortable: MatSortable)
| 159 | |
| 160 | /** Sets the active sort id and determines the new sort direction. */ |
| 161 | sort(sortable: MatSortable): void { |
| 162 | if (this.active != sortable.id) { |
| 163 | this.active = sortable.id; |
| 164 | this.direction = sortable.start ? sortable.start : this.start; |
| 165 | } else { |
| 166 | this.direction = this.getNextSortDirection(sortable); |
| 167 | } |
| 168 | |
| 169 | this.sortChange.emit({active: this.active, direction: this.direction}); |
| 170 | } |
| 171 | |
| 172 | /** Returns the next sort direction of the active sortable, checking for potential overrides. */ |
| 173 | getNextSortDirection(sortable: MatSortable): SortDirection { |
nothing calls this directly
no test coverage detected