问题描述
我的目的是使用此select
在我的惰性加载模块中:
imports: [
CommonModule,FormsModule,NgSelectModule
],providers: []
模板:
<ng-select [items]="list" [bindLabel]="TIPE" bindValue="id" [(ngModel)]="tipe" (onChange)="changeValue($event)" >
</ng-select>
:
Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[InjectionToken ng-select-selection-model -> InjectionToken ng-select-selection-model -> InjectionToken ng-select-selection-model]:
NullInjectorError: No provider for InjectionToken ng-select-selection-model!
NullInjectorError: R3InjectorError(AppModule)[InjectionToken ng-select-selection-model -> InjectionToken ng-select-selection-model -> InjectionToken ng-select-selection-model]:
NullInjectorError: No provider for InjectionToken ng-select-selection-model!
我不明白为什么,有人可以帮助我吗?
解决方法
我们遇到了另一个问题。我们使用了@ ng-select / ng-select“:” 3.7.2“,并且第三方组件之一使用了版本3.7.3。
我们更新到相同版本后,问题消失了。
,我遇到了同样的问题,我在主应用程序模块和组件模块中都导入了NgSelectModule
,并且它是固定的。
您可能还想看看this。