()
| 172 | private _inputsInitialized = false; |
| 173 | |
| 174 | ngOnInit() { |
| 175 | const list = this._selectionList; |
| 176 | |
| 177 | if (list._value && list._value.some(value => list.compareWith(this._value, value))) { |
| 178 | this._setSelected(true); |
| 179 | } |
| 180 | |
| 181 | const wasSelected = this._selected; |
| 182 | |
| 183 | // List options that are selected at initialization can't be reported properly to the form |
| 184 | // control. This is because it takes some time until the selection-list knows about all |
| 185 | // available options. Also it can happen that the ControlValueAccessor has an initial value |
| 186 | // that should be used instead. Deferring the value change report to the next tick ensures |
| 187 | // that the form control value is not being overwritten. |
| 188 | Promise.resolve().then(() => { |
| 189 | if (this._selected || wasSelected) { |
| 190 | this.selected = true; |
| 191 | this._changeDetectorRef.markForCheck(); |
| 192 | } |
| 193 | }); |
| 194 | this._inputsInitialized = true; |
| 195 | } |
| 196 | |
| 197 | override ngOnDestroy(): void { |
| 198 | super.ngOnDestroy(); |
nothing calls this directly
no test coverage detected