最佳答案
您只需要这一行:
this.selectedCityIds = this.selectedCityIds.filter(s => s != id);
你可以在你的函数中以这种方式使用它;
deleteSingle (id: string) {
this.selectedCityIds = this.selectedCityIds.filter(s => s != id);
}
关于angular - ng-select 在 Angular 6 中以编程方式删除元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59967555/