我有一个 ng-select 组件。我想修剪用户在输入时输入的输入文本。我有下面的代码,我可以获取用户输入的文本,但我无法找到将修剪后的文本放回 ng-select 的方法。
<ng-select #vehicleInfoSelect [allowClear]="true"
[(items)]="vehicleNumberList"
(selected)="vehicleNoSelected($event)"
(removed)="vehicleNoRemoved($event)"
(typed)="vehicleNumberTyped($event)"
placeholder="{{'vehicleInfo.placeHolder.filterVehicleNumberSelectBox'|translate}}">
</ng-select>
打字稿代码
@ViewChild('vehicleInfoSelect') public vehicleInfoSelect: SelectComponent;
vehicleNumberTyped(text:String){
console.log(text);
// here i want to trim the text and
// set the input field of the ng-select;
}
任何帮助都会很棒。谢谢..