The value displayed in the trigger.
()
| 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() { |