NG Kit

Controlled

Drives every piece of state from the outside. The committed value, the inputValue (text in the box) and the open state are independent two-way models, so external buttons can set or reset each one at will.

Usage

Import AutocompleteComponent and configure it with the inputs below. The full runnable source is on the Examples tab.

html
<autocomplete
  [options]="films"
  [(value)]="value"
  [(inputValue)]="inputValue"
  [(open)]="open"
  appearance="outline"
  label="Movie" />

API

This example demonstrates the inputs below. See the Autocomplete introduction for the complete API — every input, output, content template and filter helper.

Inputs

NameTypeDefaultDescription
valueT | T[] | nullnullTwo-way selected value (model). An array when multiple.
inputValuestring''Two-way text shown in the box (model); independent of value.
openbooleanfalseTwo-way popup open state (model).