[Chartjs]-Error: [$injector:unpr] Unknown provider: chart.jsProvider

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);

Leave a comment