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

Method _setSelection

src/cdk/listbox/listbox.ts:902–911  ·  view source on GitHub ↗

* Set the selected values. * @param value The list of new selected values.

(value: readonly T[])

Source from the content-addressed store, hash-verified

900 * @param value The list of new selected values.
901 */
902 private _setSelection(value: readonly T[]) {
903 if (this._invalid) {
904 this.selectionModel.clear(false);
905 }
906 this.selectionModel.setSelection(...this._coerceValue(value));
907
908 if (!this._hasFocus) {
909 this._setNextFocusToSelectedOption();
910 }
911 }
912
913 /** Sets the first selected option as first in the keyboard focus order. */
914 private _setNextFocusToSelectedOption() {

Callers 2

valueMethod · 0.95
writeValueMethod · 0.95

Calls 4

_coerceValueMethod · 0.95
setSelectionMethod · 0.80
clearMethod · 0.65

Tested by

no test coverage detected