为什么我无法呈现此 angularJS 代码?
Why can't I render this angularJS code?
此代码取自以下使用 ZingChart 的教程。
http://www.zingchart.com/blog/2015/03/05/zingchart-angularjs/
我的代码如下所示:
//my-zingchart.html
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js">
<script src="http://cdn.zingchart.com/zingchart.min.js">
<script src="node_modules/zingchart-angularjs/src/zingchart-angularjs.js">
<script>
var app = angular.module('myApp',['zingchart-angularjs']);
app.controller('MainController', function($scope){
$scope.myData = [1,4,5,5,10];
});
</script>
</head>
<body>
<div ng-controller="MainController">
<zingchart id="chart-1" zc-values="myData"></zingchart>
</div>
</body>
</html>
当我尝试在 chrome 中呈现此内容时,我只得到一个空白页面和以下错误:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=myApp&p1=Error%3A%…gleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A17%3A381)
我查找过类似的错误,但他们的解决方案似乎无法解决我的问题。
关闭您的脚本标签!
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="http://cdn.zingchart.com/zingchart.min.js"></script>
<script src="node_modules/zingchart-angularjs/src/zingchart-angularjs.js"></script>
<script>
var app = angular.module('myApp', ['zingchart-angularjs']);
app.controller('MainController', function ($scope) {
$scope.myData = [1, 4, 5, 5, 10];
});
</script>
</head>
<body>
<div ng-controller="MainController">
<zingchart id="chart-1" zc-values="myData"></zingchart>
</div>
</body>
</html>
结果
此代码取自以下使用 ZingChart 的教程。 http://www.zingchart.com/blog/2015/03/05/zingchart-angularjs/
我的代码如下所示:
//my-zingchart.html
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js">
<script src="http://cdn.zingchart.com/zingchart.min.js">
<script src="node_modules/zingchart-angularjs/src/zingchart-angularjs.js">
<script>
var app = angular.module('myApp',['zingchart-angularjs']);
app.controller('MainController', function($scope){
$scope.myData = [1,4,5,5,10];
});
</script>
</head>
<body>
<div ng-controller="MainController">
<zingchart id="chart-1" zc-values="myData"></zingchart>
</div>
</body>
</html>
当我尝试在 chrome 中呈现此内容时,我只得到一个空白页面和以下错误:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=myApp&p1=Error%3A%…gleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A17%3A381)
我查找过类似的错误,但他们的解决方案似乎无法解决我的问题。
关闭您的脚本标签!
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="http://cdn.zingchart.com/zingchart.min.js"></script>
<script src="node_modules/zingchart-angularjs/src/zingchart-angularjs.js"></script>
<script>
var app = angular.module('myApp', ['zingchart-angularjs']);
app.controller('MainController', function ($scope) {
$scope.myData = [1, 4, 5, 5, 10];
});
</script>
</head>
<body>
<div ng-controller="MainController">
<zingchart id="chart-1" zc-values="myData"></zingchart>
</div>
</body>
</html>
结果