]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/share/combobox/combobox-entry.component.ts
LP#1775466 Angular(6) base application
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / share / combobox / combobox-entry.component.ts
1 import {Component, Input, Host, OnInit} from '@angular/core';
2 import {ComboboxComponent} from './combobox.component';
3
4 @Component({
5   selector: 'eg-combobox-entry',
6   template: '<ng-template></ng-template>'
7 })
8 export class ComboboxEntryComponent implements OnInit {
9
10     @Input() entryId: any;
11     @Input() entryLabel: string;
12     @Input() selected: boolean;
13
14     constructor(@Host() private combobox: ComboboxComponent) {}
15
16     ngOnInit() {
17         if (this.selected) {
18             this.combobox.startId = this.entryId;
19         }
20         this.combobox.addEntry(
21             {id: this.entryId, label: this.entryLabel});
22     }
23 }
24
25