Overview

tng-autocomplete is a standalone combobox that implements ControlValueAccessor for Angular forms. You supply options, a displayWith function, and handle (search) to filter or fetch options. Optional #optionTpl and #inputTpl templates customize list and selected display.

CVA search output optionTpl / inputTpl Overlay Standalone
Reactive Forms

Quick example

Basic (country search)
HTMLTSCSS

<form [formGroup]="form">
  <tng-autocomplete
    formControlName="country"
    [options]="options()"
    [displayWith]="displayCountry"
    placeholder="Search country…"
    (search)="onSearch($event)"
  />
</form>

Features

options + displayWith

Bind options (array) and displayWith (item → string) for input/list text. Form value is the selected object.

(search)

Emits the current input text so you can filter locally or call an API. Update options in response.

optionTpl / inputTpl

Optional #optionTpl (dropdown rows) and #inputTpl (selected value in input when closed).

Forms-ready

Full ControlValueAccessor; use formControlName or ngModel.

Tip: Typing clears the selection and opens the panel; (search) fires so you can filter or fetch. Select an option to set the form value.