Skip to content

Commit d932dbd

Browse files
authored
Merge branch '8.2.x' into mdragnev/fix-4780-8.2.x
2 parents 6e1ab97 + 85f48bf commit d932dbd

File tree

3 files changed

+615
-461
lines changed

3 files changed

+615
-461
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Ignite UI for Angular Change Log
22

33
All notable changes for each version of this project will be documented in this file.
4+
## 8.2.6
5+
### New Features
6+
- `IgxSelectItem`
7+
- `text` input is added. By default, the Select component will display the selected item's element inner text. In cases with a more complex item template, where more than just text interpolation is used, set the text property to specify what to display in the select field when the item is selected.
8+
49
## 8.2.4
510
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
611
- The header text of the columns and the column groups now has the `title` attribute set to it in order to expose a native browser tooltip.

projects/igniteui-angular/src/lib/select/select-item.component.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
11
import { IgxDropDownItemComponent } from './../drop-down/drop-down-item.component';
2-
import { Component, DoCheck } from '@angular/core';
2+
import { Component, DoCheck, Input } from '@angular/core';
33

44
@Component({
55
selector: 'igx-select-item',
66
template: '<ng-content></ng-content>'
77
})
88
export class IgxSelectItemComponent extends IgxDropDownItemComponent implements DoCheck {
99

10+
private _text: any;
11+
12+
/**
13+
* An @Input property that gets/sets the item's text to be displayed in the select component's input when the item is selected.
14+
*
15+
* ```typescript
16+
* //get
17+
* let mySelectedItem = this.dropDown.selectedItem;
18+
* let selectedItemText = mySelectedItem.text;
19+
* ```
20+
21+
* ```html
22+
* // set
23+
* <igx-select-item [text]="'London'"></igx-select-item>
24+
* ```
25+
*/
26+
@Input()
27+
public get text(): string {
28+
return this._text;
29+
}
30+
31+
public set text(text: string) {
32+
this._text = text;
33+
}
34+
1035
/** @hidden @internal */
1136
public get itemText() {
37+
if (this._text !== undefined) {
38+
return this._text;
39+
}
1240
return this.elementRef.nativeElement.innerText.trim();
1341
}
1442

0 commit comments

Comments
 (0)