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

Method triggerValue

src/material/select/select.ts:867–884  ·  view source on GitHub ↗

The value displayed in the trigger.

()

Source from the content-addressed store, hash-verified

865
866 /** The value displayed in the trigger. */
867 get triggerValue(): string {
868 if (this.empty) {
869 return '';
870 }
871
872 if (this._multiple) {
873 const selectedOptions = this._selectionModel.selected.map(option => option.viewValue);
874
875 if (this._isRtl()) {
876 selectedOptions.reverse();
877 }
878
879 // TODO(crisbeto): delimiter should be configurable for proper localization.
880 return selectedOptions.join(', ');
881 }
882
883 return this._selectionModel.selected[0].viewValue;
884 }
885
886 /** Refreshes the error state of the select. */
887 updateErrorState() {

Callers

nothing calls this directly

Calls 1

_isRtlMethod · 0.95

Tested by

no test coverage detected