ฉันมีรูปแบบรวม 3 dropdowns นี้ dropdown เอาของข้อมูลจากรูปแบบ api ปัญหาคือ dropdown ไม่ให้พวกข้อมูลถ้าฉันไม่คลิกที่ปุ่ม dropdown(เบลอแบบไหนยื่นอยู่ในรูปแบบ)
ของฉันแบบ HTML
<form [formGroup]="dropdownsForm" novalidate class="needs-validation">
<div class="dropdown">
<select class="form-control" formControlName="CountryName"
[attr.data-live-search]="true" style="width: 150px;" >
<option *ngFor="let Country of allCountrys" [value]="Country.id">
{{Country.title}}</option>
</select>
</div>
</form>
ฉัน ts
allCountrys: DropDownListForLkpsDto[];
constructor(
private fb: FormBuilder,
private _countryService: CountryServiceProxy
) {
}
ngOnInit(): void {
this.dropdownsForm = this.fb.group(
{
CountryName: [""],
}
);
this._countryService.getAllCountrysForDDl().subscribe(result => {
this.allCountrys = result;
});
}