* Sets the selected state of the option. * @returns Whether the value has changed.
(selected: boolean)
| 268 | * @returns Whether the value has changed. |
| 269 | */ |
| 270 | _setSelected(selected: boolean): boolean { |
| 271 | if (selected === this._selected) { |
| 272 | return false; |
| 273 | } |
| 274 | |
| 275 | this._selected = selected; |
| 276 | |
| 277 | if (selected) { |
| 278 | this._selectionList.selectedOptions.select(this); |
| 279 | } else { |
| 280 | this._selectionList.selectedOptions.deselect(this); |
| 281 | } |
| 282 | |
| 283 | this.selectedChange.emit(selected); |
| 284 | this._changeDetectorRef.markForCheck(); |
| 285 | return true; |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Notifies Angular that the option needs to be checked in the next change detection run. |
no test coverage detected