MCPcopy
hub / github.com/angular/components / isSelected

Method isSelected

src/cdk-experimental/selection/selection.ts:170–176  ·  view source on GitHub ↗

Checks whether a value is selected. `index` is required if `trackBy` is used.

(value: T, index?: number)

Source from the content-addressed store, hash-verified

168
169 /** Checks whether a value is selected. `index` is required if `trackBy` is used. */
170 isSelected(value: T, index?: number) {
171 if (!!this.trackByFn && index == null && (typeof ngDevMode === 'undefined' || ngDevMode)) {
172 throw Error('CdkSelection: index required when trackBy is used');
173 }
174
175 return this._selection.isSelected({value, index});
176 }
177
178 /** Checks whether all values are selected. */
179 isAllSelected() {

Callers 1

toggleSelectionMethod · 0.95

Calls 1

isSelectedMethod · 0.65

Tested by

no test coverage detected