2017-03-06 58 views
0

我在這的jsfiddle角應用:JSFiddle投擲modulerr錯誤;爲什麼這個角度應用程序被破壞?

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) { 

回答

1

爲了使角模塊加載,你需要將其「內聯」放入主體(在onLoad事件中爲Actualy)。

更改的JavaScript選項 「LOAD類型」 爲 「無負載 - 包裹身體」

https://jsfiddle.net/kvsek6sw/1/

<div ng-app="App"> 
</div> 

<script> 
//your angular module 
</sctipt> 
0

這就是你必須做一個小的jsfiddle配置:

在JavaScript窗口,請參閱

參數>負載類型>沒有換行<body>

enter image description here

Fixed Fiddle
相關問題