i have an angular 5 project with bootstrap. in one of my component html i have a select box. when i click on it a list of drop down items are displayed and i can choose one . however i want the user to type for some string so that the drop down items can be narrowed down. here is my current code snippet any idea how can i convert the select box to an editable one .
<select formControlName="contactList" [compareWith]="compareResource">
<option value="" disabled>{{ 'PLACEHOLDERS.CONTACT_LIST' | translate }}</option>
<option *ngFor="let contactList of contactLists" [ngValue]="contactList">{{ contactList.name }}</option>
</select>
i want to convert the existing select box code to editable select box. please share your thoughts on this . i am very much new to UI programming. thank you
This can be achieved by using ng-select
Install ng-select
app.module.ts
Import it to the module
style.css
import the ng-select default styling
app.component.html
Create the ng-select dropdown by binding nameList as the items array for the dropdown and search function
app.component.ts
Initialize the nameList and define the search function. Here I will return names which contain the value entered from the dropdown