Replace 'multiple' property with 'isShowCheckbox' in NbOptionComponent to control it outside
- 主要语言
- TypeScript
- 星标
- 8.1k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Issue type
**I'm submitting a ...** (check one with "x")
* [ ] bug report
* [x] feature request
### Issue description
**Current behavior:**
NbOptionComponent has _multiple_ property, which determines whether option should be with checkbox (multiple select).
After adding new _autocomplete component_ (https://github.com/akveo/nebular/pull/1947) _parent_ property may not be set, because NbOptionComponent can be used in NbAutocompleteComponent, which doesn't have _multiple_ property. So now we have check on _multiple_ property getter.
**Expected behavior:**
Control of multiple select mode outside component via _isShowCheckbox_.
**Related code:**
```
get multiple() {
// We check parent existing because parent can be NbSelectComponent or
// NbAutocomplete and `miltiple` property exists only in NbSelectComponent
return this.parent ? (>this.parent).multiple : false;
}
```
**Angular, Nebular**
```
Angular: 8.0.0
Nebular 4.2.1
```
贡献指南
评估
这个 Issue 还没有评估数据。