New to Kendo UI for Angular? Start a free 30-day trial
Value Binding
The selected value of the AutoComplete can only be a string value.
To set the value, use the [value]
property binding of the component or the ngModel
binding. When the value changes, the AutoComplete triggers the valueChange
event.
- To define multiple values, use the MultiSelect. For more information, refer to its overview article.
- To define selected values as data of the primitive (strings, numbers, or other) or complex (objects) type, use the ComboBox. For more information, refer to its overview article.
- The AutoComplete does not support values, which contain
\n
new line characters. The regularinput
HTML DOM element, which is used internally by the AutoComplete, treats\n
as a regular whitespace. Therefore, when the component compares the value of theinput
element with the data item that is selected by the user, the two values differ. The value of theinput
element is actually not present in the data of the component and the AutoComplete does not recognize it. To handle such issues, map the incoming data so that it contains regular whitespaces only.
The following example demonstrates how to select an item in the AutoComplete.
Change Theme
Theme
Loading ...