$injector:modulerr 同时使用 angular-chartist
$injector:modulerr while using angular-chartist
刚刚将 angular-chartist 添加到我的应用程序,现在出现以下错误:
Failed to instantiate module routerApp due to:
Error: [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=...)
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:6:417
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:35:320
at s (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:7:302)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:34:399)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:35:63
at s (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:7:302)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:34:399)
at ab (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:38:135)
at d (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:17:381
我认为这个错误发生在我定义 angular 应用程序时:
//define Angular app
var routerApp = angular.module("routerApp", ["ui.router", "angular-chartist"]);
我是不是设置有误?
以下代码也处理 angular-chartist:
//draw chart
var drawChart = function(results) {
var data = {
labels: [],
series: []
}
for (var i = 0; i < results.length; i++) {
data.labels.push(results[i].trait);
data.series.push(results[i].normalized);
}
new Chartist.Bar('.ct-chart ct-perfect-fourth', data);
};
您可以找到 angular-chartist here
的文档
请确保您还在 index.html
中的 angular-chartist
:
之前的任意位置添加了 chartist.js
<script type="text/javascript" src="bower_components/chartist/dist/chartist.min.js"></script>
刚刚将 angular-chartist 添加到我的应用程序,现在出现以下错误:
Failed to instantiate module routerApp due to:
Error: [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=...)
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:6:417
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:35:320
at s (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:7:302)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:34:399)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:35:63
at s (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:7:302)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:34:399)
at ab (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:38:135)
at d (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:17:381
我认为这个错误发生在我定义 angular 应用程序时:
//define Angular app
var routerApp = angular.module("routerApp", ["ui.router", "angular-chartist"]);
我是不是设置有误?
以下代码也处理 angular-chartist:
//draw chart
var drawChart = function(results) {
var data = {
labels: [],
series: []
}
for (var i = 0; i < results.length; i++) {
data.labels.push(results[i].trait);
data.series.push(results[i].normalized);
}
new Chartist.Bar('.ct-chart ct-perfect-fourth', data);
};
您可以找到 angular-chartist here
的文档请确保您还在 index.html
中的 angular-chartist
:
chartist.js
<script type="text/javascript" src="bower_components/chartist/dist/chartist.min.js"></script>