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

Method deselect

src/cdk-experimental/selection/selection-set.ts:86–105  ·  view source on GitHub ↗
(...selects: SelectableWithIndex<T>[])

Source from the content-addressed store, hash-verified

84 }
85
86 deselect(...selects: SelectableWithIndex<T>[]) {
87 if (!this._multiple && selects.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {
88 throw Error('SelectionSet: not multiple selection');
89 }
90
91 const before = this._getCurrentSelection();
92 const toDeselect: SelectableWithIndex<T>[] = [];
93
94 for (const select of selects) {
95 if (!this.isSelected(select)) {
96 continue;
97 }
98
99 toDeselect.push(select);
100 this._markDeselected(this._getTrackedByValue(select));
101 }
102
103 const after = this._getCurrentSelection();
104 this.changed.next({before, after});
105 }
106
107 private _markSelected(key: T | ReturnType<TrackByFunction<T>>, toSelect: SelectableWithIndex<T>) {
108 this._selectionMap.set(key, toSelect);

Callers

nothing calls this directly

Calls 6

_getCurrentSelectionMethod · 0.95
isSelectedMethod · 0.95
_markDeselectedMethod · 0.95
_getTrackedByValueMethod · 0.95
pushMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected