5👍
Since angular-chart.js
is itself a module, it must be injected into the module and cannot be injected into the controller.
1👍
With JGOakley’s clarification, I was able to discover this line in angular-chart.js
return angular.module('chart.js', [])
.provider('ChartJs', ChartJsProvider)
To include this for use in your controller:
YourModule.$inject = ['ChartJs'];
This was a frustrating find, since I took this line to mean I could reference it as chart
define(['angular', 'chart'], factory);
- [Chartjs]-In ChartJS is it possible to change the line style between different points?
- [Chartjs]-Why isn't my Angular 4 ChartJS component rendering?
Source:stackexchange.com