我在JSFiddle中有这个角度应用程序:
https://jsfiddle.net/horacebury/kvsek6sw/
为什么会抛出modulerr错误?
HTML格式正确:
<div ng-app="App">
<div ng-controller="TodoCtrl">
<div id="tablecontainer">
<table class="tgh">
<thead>
<tr>
<th><p>Auxilliary Power</p></th>
</tr>
</thead>
</table>
<div id="handscontainer">
<div id="example"></div>
</div>
<table class="tg">
<tr>
<td style="width: 146px;"></td>
<td class="tg-yw4l" ng-repeat="item in items track by $index">{{item}}</td>
</tr>
</table>
</div>
<div id="TrendChart"></div>
</div>
</div>
模块和控制器语句的结构正确,外部引用都存在:
angular.module('App', [])
.controller("TodoCtrl", ['$scope', '$timeout', function($scope,$timeout) {
答案 0 :(得分:1)
要加载角度模块,您需要将其“内联”放入正文中(Actualy in onLoad事件)。
将javascript选项“LOAD TYPE”更改为“No load - wrap in body”
https://jsfiddle.net/kvsek6sw/1/
<div ng-app="App">
</div>
<script>
//your angular module
</sctipt>
答案 1 :(得分:0)