【发布时间】:2018-08-07 22:03:43
【问题描述】:
我正在使用 Angular 4 的剑道自动完成功能,我试图在从弹出窗口中选择值后清除自动完成框中的文本。
<div class="example-wrapper">
<kendo-autocomplete [data]="listItems" [value]="country"
[placeholder]="'e.g. Andorra'" (valueChange)="locationValueChange($event)">
</kendo-autocomplete>
<div *ngFor="let location of selectedValues; let i = index;">
{{location}}
</div>
</div>
public listItems: Array<string> = ["Albania", "Andorra", "Armenia", "Austria", "Azerbaijan"];
public country: string = "Austria";
public selectedValues: Array<string[]> = [];
public locationValueChange(value: any): void {
this.selectedValues.push(value);
this.country='';
console.log(this.country);
}
即使我将值字段设置为无。它仍然有数据在框中。 请提出任何想法来实现这一目标。 Plunker link of code
【问题讨论】:
标签: angular kendo-ui autocomplete kendo-ui-angular2