MCPcopy Index your code
hub / github.com/angular/components / select

Method select

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

Source from the content-addressed store, hash-verified

58 }
59
60 select(...selects: SelectableWithIndex<T>[]) {
61 if (!this._multiple && selects.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {
62 throw Error('SelectionSet: not multiple selection');
63 }
64
65 const before = this._getCurrentSelection();
66
67 if (!this._multiple) {
68 this._selectionMap.clear();
69 }
70
71 const toSelect: SelectableWithIndex<T>[] = [];
72 for (const select of selects) {
73 if (this.isSelected(select)) {
74 continue;
75 }
76
77 toSelect.push(select);
78 this._markSelected(this._getTrackedByValue(select), select);
79 }
80
81 const after = this._getCurrentSelection();
82
83 this.changed.next({before, after});
84 }
85
86 deselect(...selects: SelectableWithIndex<T>[]) {
87 if (!this._multiple && selects.length > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {

Callers

nothing calls this directly

Calls 7

_getCurrentSelectionMethod · 0.95
isSelectedMethod · 0.95
_markSelectedMethod · 0.95
_getTrackedByValueMethod · 0.95
clearMethod · 0.65
pushMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected