Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng2-charts angular radar exception

i want to display 2 component in a dashboard one radar and the other is line, so i have 3 separate component.

when i implemented the radar component i started to get this exception in the radar component.

ERROR NullInjectorError: StaticInjectorError(AppModule)[BaseChartDirective -> ThemeService]: 
  StaticInjectorError(Platform: core)[BaseChartDirective -> ThemeService]: 
    NullInjectorError: No provider for ThemeService!

i followed the docs provided in here: https://stackblitz.com/edit/ng2-charts-radar-template?file=src%2Fapp%2Fapp.component.ts .. i have no idea whats causing this problem..

like image 727
أيمن تليلي Avatar asked Apr 19 '26 05:04

أيمن تليلي


1 Answers

finally i'v fixed this problem, only by adding providers:[ThemeService] in the app.modules.

i think this problem happens only on these version on angular 8 and ng2-chart 2.4.2

like image 115
أيمن تليلي Avatar answered Apr 21 '26 19:04

أيمن تليلي



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!