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

Method value

src/material/button-toggle/button-toggle.ts:193–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191 /** Value of the toggle group. */
192 @Input()
193 get value(): any {
194 const selected = this._selectionModel ? this._selectionModel.selected : [];
195
196 if (this.multiple) {
197 return selected.map(toggle => toggle.value);
198 }
199
200 return selected[0] ? selected[0].value : undefined;
201 }
202 set value(newValue: any) {
203 this._setSelectionByValue(newValue);
204 this.valueChange.emit(this.value);

Callers

nothing calls this directly

Calls 1

_setSelectionByValueMethod · 0.95

Tested by

no test coverage detected