wrap kendo-chart with another component - NullInjectorError: No provider for ConfigurationService!

0 Answers 636 Views
Charts
Alex
Top achievements
Rank 1
Iron
Iron
Alex asked on 13 Apr 2023, 03:50 PM | edited on 13 Apr 2023, 03:52 PM

Hello,

I'm trying to create a custom component, say <my-chart>,  containing a <kendo-chart>.

I'd like to be able to pass the configuration by components to my-chart and forward them to the <kendo-chart> inside my component.

In the template of my-chart I've put 

<kendo-chart><ng-content></ng-content></kendo-chart>

Then, in my app, if I do:

<my-chart>
  <kendo-chart-series>
    <kendo-chart-series-item [data]="[1, 4, 5, 2, 1, 8]"> </kendo-chart-series-item>
  </kendo-chart-series>
</my-chart>

I get the following error in the console when the page loads:

Error: R3InjectorError(AppModule)[ConfigurationService -> ConfigurationService -> ConfigurationService]:
NullInjectorError: No provider for ConfigurationService!

Here is a StackBlitz to replicate the error: https://angular-mmhsaz.stackblitz.io

Thank you.

Regards

No answers yet. Maybe you can help?

Tags
Charts
Asked by
Alex
Top achievements
Rank 1
Iron
Iron
Share this question
or