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

Method setAllSelected

src/cdk/listbox/listbox.ts:551–560  ·  view source on GitHub ↗

* Set the selected state of all options. * @param isSelected The new selected state to set

(isSelected: boolean)

Source from the content-addressed store, hash-verified

549 * @param isSelected The new selected state to set
550 */
551 setAllSelected(isSelected: boolean) {
552 if (!isSelected) {
553 this.selectionModel.clear();
554 } else {
555 if (this._invalid) {
556 this.selectionModel.clear(false);
557 }
558 this.selectionModel.select(...this.options.map(option => option.value));
559 }
560 }
561
562 /**
563 * Get whether the given option is selected.

Callers 1

listbox.spec.tsFile · 0.80

Calls 2

clearMethod · 0.65
selectMethod · 0.65

Tested by

no test coverage detected