Can't use inputs: No provider for InjectionToken ComponentInjector
See original GitHub issueI need to use inputs for dynamic components. Since Angular does not have an easy way to do this, I found this module and gave it a try. When I use it passing just a component class, it’s working, renders properly. However, when I add inputs, I get such error:
StaticInjectorError(AppModule)[DynamicDirective ->InjectionToken ComponentInjector]:
NullInjectorError: No provider for InjectionToken ComponentInjector!
I’ve tried different notation just for checking (<ndc-dynamic [ndcDynamicComponent]="component" [ndcDynamicInputs]="inputs"
and <ng-container *ngComponentOutlet="component; ndcDynamicInputs: inputs;
), result is the same.
Any hints? angular: ^7.2.16 ng-dynamic-component: ^4.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Angular InjectionToken throws 'No provider for InjectionToken'
For this I'm using an Injector , and loading the the service during ngOnInit . This works fine when using a string based...
Read more >NG0201: No provider for {token} found! - Angular
A provider is a mapping that supplies a value that you can inject into the constructor of a class in your application. Read...
Read more >Dependency Injection | AngularDart Community Documentation
Angular has its own dependency injection framework, and you really can't build an Angular app ... You have no control over the car's...
Read more >React Context In Angular - DEV Community
In other words, context can help you to pass down inputs/props ... will have the value of the Context because there's no provider...
Read more >Testing Dependency Injection • Angular - codecraft.tv
We can resolve dependencies in our tests using a number of methods. ... the Component's Providers; Resolving via the Component's Injector; Summary; Listing ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What I meant is you may want to update to at least Angular v8 and then you will be able to use latest version of this library. But it is just an advise so you can eliminate all the bugs that were fixed since version 4.
I will close this issue then.
I have an app with Angular version in 8, and i upgrade to v6 and works, v5 throw the error