问题描述
我更新了我的angular2项目,并且该项目无法正常工作.但是现在我收到以下错误:
I updated my angular2 project and before it was working fine. However now I am getting the following error:
Error: Uncaught (in promise): Error: Error in ./RibbonComponent class
RibbonComponent - inline template:4:5 caused by: No provider for
ComponentLoaderFactory!
Error: Error in ./RibbonComponent class RibbonComponent - inline
template:4:5 caused by: No provider for ComponentLoaderFactory!
ComponentLoaderFactory
ComponentLoaderFactory
export declare class ComponentLoaderFactory {
private _componentFactoryResolver;
private _ngZone;
private _injector;
private _posService;
constructor(componentFactoryResolver: ComponentFactoryResolver, ngZone: NgZone, injector: Injector, posService: PositioningService);
/**
*
* @param _elementRef
* @param _viewContainerRef
* @param _renderer
* @returns {ComponentLoader}
*/
createLoader<T>(_elementRef: ElementRef, _viewContainerRef: ViewContainerRef, _renderer: Renderer): ComponentLoader<T>;
}
我不确定还要发布什么.我所有的人都通过ncu
而不是ncu -u
使package.json保持最新状态.我以为我发现了一个错误.我确实在GitHub上找到了一个帖子,但没有帮助. GitHub
I am not sure what else to post. All my made my package.json up to date via ncu
than ncu -u
. I am being to think I found a bug. I did find a post on GitHub but it did not help. GitHub
如果我需要发布其他任何内容,请告诉我.
If I need to post anything else let me know.
推荐答案
不确定使用的是什么库,但是使用 ng2-bootstrap 时出现此错误.从此页面获得了解决方案Ref angular-2-with-ng2-bootstrap-and-karma-testing-final-adventure .
Not sure what libraries you are using, but I had this error when using ng2-bootstrap. Got the solution from this page Ref angular-2-with-ng2-bootstrap-and-karma-testing-final-adventure.
本质上,问题出在需要调用.forRoot()
方法的导入中.也许在RibbonComponent或其他导入的库中寻找类似的东西.
Essentially, the problem was with an import that required the .forRoot()
method to be called. Maybe look for something similar in the RibbonComponent or other imported library.
这篇关于没有ComponentLoaderFactory的提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!