Skip to content
Permalink
74000d70c2
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
32 lines (25 sloc) 885 Bytes
import { Component, OnInit } from '@angular/core';
import { EndItemService } from 'src/app/services/enditem.service';
import { GeiaService } from 'src/app/services/api/geia.service';
import { SelectItem } from 'primeng/api';
@Component({
selector: 'app-dropdown',
templateUrl: './dropdown.component.html',
styleUrls: ['./dropdown.component.css']
})
export class DropdownComponent implements OnInit {
constructor(
private endItemService: EndItemService,
private geiaService: GeiaService
) {}
xaList: SelectItem[];
selectedEndItem: any;
async ngOnInit() {
const xas = await this.geiaService.getXAs().toPromise();
this.xaList = xas.map(xa => ({ label: xa.endItemAcronymCode, value: xa }));
this.xaList.unshift({ label: 'None selected', value: null });
}
onChange(event: any) {
this.endItemService.setEndItem(this.selectedEndItem);
}
}