这是我在视图中的代码:
@{
ViewBag.Title = "graph";
}
<link href="~/Content/angular-chart.css" rel="stylesheet" />
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<script src="~/Scripts/bootstrap.js"></script>
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/Site.js"></script>
<script src="~/Scripts/angular-chart.js"></script>
<h2>graph</h2>
@Scripts.Render("~/bundles/jquerynew")
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<link href="~/Content/Site.css" rel="stylesheet" />
<link href="~/Content/angular-chart.css" rel="stylesheet" />
<script src="~/Scripts/angular-chart.js"></script>
<div ng-app="appl" ng-controller="PolarAreaCtrl">
<canvas id="polar-area" class="chart chart-polar-area" data="data" labels="labels">g</canvas>
</div>
<div ng-app="myApp" >
<div ng-controller="g" >
Test: {{ 1+2 }}
</div>
</div>
@Scripts.Render("~/bundles/angular")
@Styles.Render("~/Content/css")
这是我在sitejs文件中的代码:
angular.module("appl", ["angular-chart.js"]).controller("PolarAreaCtrl", function ($scope) {
$scope.labels = ["Download Sales", "In-Store Sales", "Mail-Order Sales", "Tele Sales", "Corporate Sales"];
$scope.data = [300, 500, 100, 40, 120];
});
var app = angular.module('myApp', []);
app.controller("test", function ($scope) {
});
app.controller('g', function ($scope, $http) {
});
但是当我运行应用程序时,页面上没有任何内容。是什么原因 ? 我想要基于控制器中的值的图形。 这是角度js以及角度图的新手。 请帮帮我。