Class IgxAutocompleteDirective

Ignite UI for Angular Autocomplete - Documentation

The igxAutocomplete directive provides a way to enhance a text input by showing a drop down of suggested options, provided by the developer.

Example:

<input type="text" [igxAutocomplete]="townsPanel" #autocompleteRef="igxAutocomplete"/>
<igx-drop-down #townsPanel>
<igx-drop-down-item *ngFor="let town of towns | startsWith:townSelected" [value]="town">
{{town}}
</igx-drop-down-item>
</igx-drop-down>

Hierarchy

Hierarchy (view full)

Implements

  • OnDestroy
  • AfterViewInit
  • OnInit

Constructors

Properties

autocompleteSettings: AutocompleteOverlaySettings

Provide overlay settings for the autocomplete drop down

// get
let settings = this.autocomplete.autocompleteSettings;
<!--set-->
<input type="text" [igxAutocomplete]="townsPanel" [igxAutocompleteSettings]="settings"/>
// set
this.settings = {
positionStrategy: new ConnectedPositioningStrategy({
closeAnimation: null,
openAnimation: null
})
};
disabled: boolean = false

Enables/disables autocomplete component

// get
let disabled = this.autocomplete.disabled;
<!--set-->
<input type="text" [igxAutocomplete]="townsPanel" [igxAutocompleteDisabled]="disabled"/>
// set
public disabled = true;
dropdown: IgxDropDownBaseDirective
selectionChanging: EventEmitter<AutocompleteSelectionChangingEventArgs> = ...

Emitted after item from the drop down is selected

<input igxInput [igxAutocomplete]="townsPanel" (selectionChanging)='selectionChanging($event)' />

Accessors

Methods