MCPcopy
hub / github.com/angular/components / _markSelected

Method _markSelected

src/cdk/collections/selection-model.ts:210–225  ·  view source on GitHub ↗

Selects a value.

(value: T)

Source from the content-addressed store, hash-verified

208
209 /** Selects a value. */
210 private _markSelected(value: T) {
211 value = this._getConcreteValue(value);
212 if (!this.isSelected(value)) {
213 if (!this._multiple) {
214 this._unmarkAll();
215 }
216
217 if (!this.isSelected(value)) {
218 this._selection.add(value);
219 }
220
221 if (this._emitChanges) {
222 this._selectedToEmit.push(value);
223 }
224 }
225 }
226
227 /** Deselects a value. */
228 private _unmarkSelected(value: T) {

Callers 3

constructorMethod · 0.95
_selectMethod · 0.95
_setSelectionMethod · 0.95

Calls 5

_getConcreteValueMethod · 0.95
isSelectedMethod · 0.95
_unmarkAllMethod · 0.95
pushMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected