首页 > 解决方案 > ng-bootstrap 没有提供 ComponentFactoryResolver - forRoot 不可用

问题描述

抱歉,我是 Angular2 新手,但在尝试使用 ng-bootstrap ngbModal 时遇到“没有 ComponentFactoryResolver 的提供者”。我知道从 v8.0 开始没有forRoot()选择。所以真的对这个错误感到困惑。

core.js:6014 ERROR Error: Uncaught (in promise): 

NullInjectorError: StaticInjectorError(AppModule)[NgbModal -> ComponentFactoryResolver]: 

StaticInjectorError(Platform: core)[NgbModal -> ComponentFactoryResolver]: 

    NullInjectorError: No provider for ComponentFactoryResolver!

NullInjectorError: StaticInjectorError(AppModule)[NgbModal -> ComponentFactoryResolver]:
 
  StaticInjectorError(Platform: core)[NgbModal -> ComponentFactoryResolver]: 

    NullInjectorError: No provider for ComponentFactoryResolver! ...

标签: ng-bootstrapng-bootstrap-modal

解决方案


推荐阅读