This code snippet demonstrates the use of ng-selector in an .html file
<ng-selector
name="company"
[(ngModel)]="company_selected"
[formControl]="loanApplyForm.controls['company']"
(loadValues)="fetchHLCompany($event)"
id-field="id" label-field="name"
[options]="company_values"
allow-creation="true"
placeholder="Search your company">
</ng-selector>
I am facing a couple of issues with this implementation. When I enter a value, it prompts to add even if the typed value is already in the list. I want it to only ask to add if the input value is not in the existing list. I tried removing 'allow-creation' but then it doesn't prompt at all. Secondly, the search functionality is not sorting results alphabetically. Any assistance on these matters would be greatly appreciated. Thank you in advance.