MCPcopy Create free account
hub / github.com/angular/components / _selectViaInteraction

Method _selectViaInteraction

src/material/core/option/option.ts:243–249  ·  view source on GitHub ↗

* `Selects the option while indicating the selection came from the user. Used to * determine if the select's view -> model callback should be invoked.`

()

Source from the content-addressed store, hash-verified

241 * determine if the select's view -> model callback should be invoked.`
242 */
243 _selectViaInteraction(): void {
244 if (!this.disabled) {
245 this._selected = this.multiple ? !this._selected : true;
246 this._changeDetectorRef.markForCheck();
247 this._emitSelectionChangeEvent(true);
248 }
249 }
250
251 /** Returns the correct tabindex for the option depending on disabled state. */
252 // This method is only used by `MatLegacyOption`. Keeping it here to avoid breaking the types.

Callers 5

_handleKeydownMethod · 0.95
_handleKeydownMethod · 0.80
select.spec.tsFile · 0.80
_handleOpenKeydownMethod · 0.80
_initKeyManagerMethod · 0.80

Calls 2

markForCheckMethod · 0.80

Tested by

no test coverage detected