我正在使用 Angular 和 Material Design。当我添加角度图表时,它不会在页面上呈现,但 chrome 的开发工具没有显示任何错误。我做错了什么?
我已经为这里设置了一个 plunker
要了解我的代码,请参阅下面的代码段
<div role="tabpanel"
id="tab1-content"
aria-labelledby="tab1"
ng-switch-when="0"
md-swipe-left="next()"
md-swipe-right="previous()"
layout="row" layout-align="center center">
<md-card flex-gt-sm="90" flex-gt-md="80">
<md-card-content>
<h2>Profile / Utilization</h2>
<canvas id="doughnut" class="chart chart-doughnut" data="data"
labels="labels"></canvas>
<md-list>
</md-list>
</md-card-content>
</md-card>
</div>
index.js
var app = angular.module('StarterApp', ['ngMaterial', 'ngMdIcons','chart.js']);
app.controller("DoughnutCtrl", function ($scope) {
$scope.labels = ["Download Sales", "In-Store Sales", "Mail-Order Sales"];
$scope.data = [300, 500, 100];});