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
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>;
}
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.
Not sure what libraries you are using, but I had this error when using ng2-bootstrap
.
I got the solution from this page: angular-2-with-ng2-bootstrap-and-karma-testing-final-adventure.
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.
for example is you are using modal of ngx-bootstrap then you should import the module in spec.ts like :-
ModalModule.forRoot()
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With