我正在尝试从材料中导入树组件i,e Tree with partially loaded data
。根据此示例,我遵循了stackblitz
我被这个错误困扰
ERROR Error: StaticInjectorError(AppModule)[ExistingOfferingsComponent->LoadmoreDatabase]:
StaticInjectorError(Platform: core)[ExistingOfferingsComponent -> LoadmoreDatabase]:
NullInjectorError: No provider for LoadmoreDatabase!
答案 0 :(得分:2)
您需要将LoadmoreDatabase
添加到providers
组件的ExistingOfferings
中:
@Component({
selector: 'existing-offerings-component',
templateUrl: 'existing-offerings-component.html',
styleUrls: ['existing-offerings-component.css'],
providers: [LoadmoreDatabase]
})
export class ExistingOfferingsComponent{
...
}