Reputation: 1220
Trying to integrate chart.js
with AngularJS
but this error is showing:
Error: $injector:modulerr Module Error
.
Failed to instantiate module chart.js
I know the is error is to do with where the link is declared in your header, but I have followed instructions from Angular Chart but to no avail. Any idea why this error is being thrown?
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-charts/0.2.7/angular-charts.min.js"></script>
<script src="scripts/app.js"></script>
var app = angular.module('myApp', ['ngRoute', 'angularMoment', 'ui.router', 'chart.js']);
Upvotes: 1
Views: 479
Reputation: 41447
Name of the chart module is angularCharts
. so inject it instead of the chart.js
var app = angular.module('myApp', ['ngRoute', 'angularMoment', 'ui.router', 'angularCharts']);
Upvotes: 2