• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM CUT coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/projects/igniteui-angular/src/lib/select/select-item.component.ts
1
import { IgxDropDownItemComponent } from './../drop-down/drop-down-item.component';
2
import { Component, Input } from '@angular/core';
3

4
@Component({
5
    selector: 'igx-select-item',
6
        templateUrl: 'select-item.component.html',
7
    standalone: true
8
})
9
export class IgxSelectItemComponent extends IgxDropDownItemComponent {
2✔
10
    /** @hidden @internal */
11
    public override isHeader: boolean;
12

13
    private _text: any;
14

15
    /**
16
     * Gets/Sets the item's text to be displayed in the select component's input when the item is selected.
17
     *
18
     * ```typescript
19
     *  //get
20
     *  let mySelectedItem = this.dropDown.selectedItem;
21
     *  let selectedItemText = mySelectedItem.text;
22
     * ```
23
     *
24
     * ```html
25
     * // set
26
     * <igx-select-item [text]="'London'"></igx-select-item>
27
     * ```
28
     */
29
    @Input()
30
    public get text(): string {
UNCOV
31
        return this._text;
×
32
    }
33

34
    public set text(text: string) {
35
        this._text = text;
242✔
36
    }
37

38
    /** @hidden @internal */
39
    public get itemText() {
40
        if (this._text !== undefined) {
378✔
41
            return this._text;
132✔
42
        }
43
        // If text @Input is undefined, try extract a meaningful item text out of the item template
44
        return this.elementRef.nativeElement.textContent.trim();
246✔
45
    }
46

47
    /**
48
     * Sets/Gets if the item is the currently selected one in the select
49
     *
50
     * ```typescript
51
     *  let mySelectedItem = this.select.selectedItem;
52
     *  let isMyItemSelected = mySelectedItem.selected; // true
53
     * ```
54
     */
55
    public override get selected() {
56
        return !this.isHeader && !this.disabled && this.selection.is_item_selected(this.dropDown.id, this);
10,578✔
57
    }
58

59
    public override set selected(value: any) {
UNCOV
60
        if (value && !this.isHeader && !this.disabled) {
×
UNCOV
61
            this.dropDown.selectItem(this);
×
62
        }
63
    }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc