Why am I getting an error when using ng-controller='DoughnutCtrl' in a dive?
Error: [ng:areq] Argument 'DoughnutCtrl' is not a function, got undefined
Here is my Chart.js code:
'use strict';
angular.module('portfolioApp',['chart.js']).
controller('DoughnutCtrl', function ($scope)
{
$scope.data = [[
{
value: 80,
color: "#949FB1",
highlight: "#A8B3C5",
label: "80%"
},
{
value: 20,
color: "#4D5360",
highlight: "#616774",
label: ""
}
],
[
{
value: 70,
color: "#000000",
highlight: "#A8B3C5",
label: "80%"
},
{
value: 30,
color: "#ffffff",
highlight: "#167740",
label: ""
}
];
});
And this is my HTML code:
<div ng-app="portfolioApp">
<div ng-controller="DoughnutCtrl">
<canvas tc-chartjs-doughnut chart-options="options" chart-data="data" auto-legend></canvas>
</div>
I am new to AngularJS, can anyone help me understand why this error is occurring?