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

Method _assignValue

src/material/select/select.ts:1099–1110  ·  view source on GitHub ↗

Assigns a specific value to the select. Returns whether the value has changed.

(newValue: any | any[])

Source from the content-addressed store, hash-verified

1097
1098 /** Assigns a specific value to the select. Returns whether the value has changed. */
1099 private _assignValue(newValue: any | any[]): boolean {
1100 // Always re-assign an array, because it might have been mutated.
1101 if (newValue !== this._value || (this._multiple && Array.isArray(newValue))) {
1102 if (this.options) {
1103 this._setSelectionByValue(newValue);
1104 }
1105
1106 this._value = newValue;
1107 return true;
1108 }
1109 return false;
1110 }
1111
1112 // `skipPredicate` determines if key manager should avoid putting a given option in the tab
1113 // order. Allow disabled list items to receive focus via keyboard to align with WAI ARIA

Callers 5

valueMethod · 0.95
writeValueMethod · 0.95
_registerModelFunction · 0.80
_onInputFunction · 0.80

Calls 1

_setSelectionByValueMethod · 0.95

Tested by

no test coverage detected