Loading...
Loading...
Implement the Syncfusion Angular AutoComplete component for type-ahead text suggestions with data binding, filtering, grouping, templates, virtualization, and form integration. Covers local and remote data sources, autofill, highlight search, custom filtering, keyboard navigation, and accessibility features. Use this when adding AutoComplete to Angular applications, configuring filtering behaviors, implementing data binding scenarios, or validating forms with autocomplete.
npx skill4agent add syncfusion/angular-ui-components-skills syncfusion-angular-autocompletegroupBy| Aspect | Details |
|---|---|
| Selection | Single item; user can also type any free-form value |
| Data Sources | Local arrays, remote DataManager, OData, Web API, Observable (async pipe) |
| Filtering | Built-in filtering: |
| Autofill | Completes the first match inline as the user types |
| Performance | Virtual scrolling for large datasets (1,000+ items) |
| Forms | Template-driven ( |
| Accessibility | WCAG 2.2 compliant, full keyboard navigation, ARIA attributes |
| Customization | Item, group, header, footer, noRecords, actionFailure templates; CSS theming |
@syncfusion/ej2-angular-dropdownsAutoCompleteModule[(value)]valuetexticonCssfieldsallowObjectBindingvaluefilterTypesuggestionCountminLengthignoreCaseignoreAccentdebounceDelayfilteringupdateDatafields.groupBynoRecordsTemplateautofillhighlightfields.disableddisableItemenabledallowResizeenableVirtualizationshowPopupButtonshowClearButtonenableRtlsortOrderngModelFormsModuleFormControlFormGroupReactiveFormsModulearia-haspopuparia-expandedaria-selectedaria-autocompleteL10n.load()noRecordsTemplateactionFailureTemplateautofillhighlightPredicatefields.iconCss// app.component.ts (Angular 21 Standalone)
import { Component } from '@angular/core';
import { AutoCompleteModule } from '@syncfusion/ej2-angular-dropdowns';
@Component({
selector: 'app-root',
standalone: true,
imports: [AutoCompleteModule],
template: `
<ejs-autocomplete
id="sports"
[dataSource]="sportsData"
placeholder="Find a sport"
[(value)]="selectedValue">
</ejs-autocomplete>
`
})
export class AppComponent {
public sportsData: string[] = [
'Badminton', 'Basketball', 'Cricket',
'Football', 'Golf', 'Hockey', 'Tennis'
];
public selectedValue: string = '';
}ng add @syncfusion/ej2-angular-dropdowns@import '../node_modules/@syncfusion/ej2-base/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-lists/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material3.css';// Map fields for object array
public fields: Object = { value: 'Game' };
public sportsData: { [key: string]: Object }[] = [
{ Id: 'Game1', Game: 'Badminton' },
{ Id: 'Game2', Game: 'Cricket' }
];<ejs-autocomplete [dataSource]="sportsData" [fields]="fields" placeholder="Find a game">
</ejs-autocomplete><ejs-autocomplete
[dataSource]="data"
[autofill]="true"
[highlight]="true"
filterType="StartsWith">
</ejs-autocomplete>import { DataManager, ODataV4Adaptor, Query } from '@syncfusion/ej2-data';
public data: DataManager = new DataManager({
url: 'https://services.odata.org/V4/Northwind/Northwind.svc/Customers',
adaptor: new ODataV4Adaptor,
crossDomain: true
});
public fields: Object = { value: 'ContactName' };
public query: Query = new Query().select(['ContactName']).take(6);
public debounceDelay: number = 500;<ejs-autocomplete
[dataSource]="data"
[fields]="fields"
[query]="query"
[debounceDelay]="debounceDelay"
filterType="StartsWith">
</ejs-autocomplete>import { AutoCompleteComponent, VirtualScroll } from '@syncfusion/ej2-angular-dropdowns';
AutoCompleteComponent.Inject(VirtualScroll);<ejs-autocomplete
[dataSource]="records"
[fields]="fields"
[enableVirtualization]="true"
popupHeight="200px">
</ejs-autocomplete>| Property | Type | Default | Purpose |
|---|---|---|---|
| Array | DataManager | | Source data for suggestions |
| FieldSettingsModel | | Map data columns to component |
| string | | Hint text when empty |
| string | number | boolean | object | | Selected/typed value |
| FilterType | | How suggestions are matched |
| number | | Minimum chars to trigger suggestions |
| number | | Max suggestions shown |
| boolean | | Inline completion of first match |
| boolean | | Highlight matched characters |
| boolean | | Case-insensitive filtering |
| boolean | — | Ignore diacritics in filtering |
| number | | Delay (ms) before filtering fires |
| boolean | | Virtual scroll for large data |
| boolean | | Resizable popup |
| boolean | | Show ✕ to clear value |
| boolean | | Show dropdown toggle button |
| boolean | | Enable/disable entire component |
| boolean | | Prevent user edits |
| boolean | | Bind value as full object |
| SortOrder | | Sort suggestions (Ascending/Descending) |
| string | number | | Popup list height |
| string | number | | Popup list width |
| string | | Localization culture |
| boolean | | Right-to-left rendering |
Need to implement AutoComplete?
│
├─ What's your data source?
│ ├─ Local array → See Data Binding: "Array of string" or "Array of object"
│ └─ Remote API → See Data Binding: "Bind to remote data"
│
├─ How should filtering work?
│ ├─ Default (Contains) → No extra config needed
│ ├─ StartsWith → filterType="StartsWith"
│ ├─ Custom multi-field → See Advanced Patterns: "Custom filtering"
│ └─ Accent-insensitive → [ignoreAccent]="true"
│
├─ Need autofill (inline completion)?
│ └─ YES → [autofill]="true" + filterType="StartsWith"
│
├─ Highlight matched text?
│ └─ YES → [highlight]="true"
│
├─ Large dataset (1,000+ items)?
│ └─ YES → [enableVirtualization]="true" + inject VirtualScroll
│
├─ Using inside a form?
│ ├─ Template-driven → See Form Support: "ngModel"
│ └─ Reactive → See Form Support: "FormControl"
│
└─ Need accessibility or localization?
└─ YES → See Accessibility & Localization reference