问题描述: 在Angular应用程序中使用ng-select组件时,可能会遇到无法在输入区域显示所选值的问题。
解决方法:
import { NgSelectModule } from '@ng-select/ng-select';
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
NgSelectModule,
FormsModule
],
// other declarations and providers
})
export class YourModule { }
{{option}}
{{option}}
.ng-select .ng-select-container {
overflow: visible !important;
}
这些解决方法应该能够解决无法在输入区域显示所选值的问题。如果问题仍然存在,请确保组件的数据和属性正确设置,并检查浏览器控制台是否有任何错误消息。