MCPcopy Create free account
hub / github.com/angular/components / sort

Method sort

src/material/sort/sort.ts:161–170  ·  view source on GitHub ↗

Sets the active sort id and determines the new sort direction.

(sortable: MatSortable)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 1

getNextSortDirectionMethod · 0.95

Tested by

no test coverage detected