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

Method _selectValue

src/material/chips/chip-listbox.ts:348–358  ·  view source on GitHub ↗

* Finds and selects the chip based on its value. * @returns Chip that has the corresponding value.

(value: any, isUserInput: boolean)

Source from the content-addressed store, hash-verified

346 * @returns Chip that has the corresponding value.
347 */
348 private _selectValue(value: any, isUserInput: boolean): MatChip | undefined {
349 const correspondingChip = this._chips.find(chip => {
350 return chip.value != null && this.compareWith(chip.value, value);
351 });
352
353 if (correspondingChip) {
354 isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select();
355 }
356
357 return correspondingChip;
358 }
359
360 /** Syncs the chip-listbox selection state with the individual chips. */
361 private _syncListboxProperties() {

Callers 1

_setSelectionByValueMethod · 0.95

Calls 3

selectViaInteractionMethod · 0.80
selectMethod · 0.65
compareWithMethod · 0.45

Tested by

no test coverage detected