无法解决index.html中的错误

时间:2016-01-01 05:51:59

标签: javascript angularjs

  

错误:file:/// F:/ test / controller / addcontrollers无法加载   resource:net :: ERR_FILE_NOT_FOUND   file:/// F:/ test / controller / showcontrollers无法加载资源:   净:: ERR_FILE_NOT_FOUND

     

angular.min.js:37未捕获错误:[$ injector:modulerr]   http://errors.angularjs.org/1.4.4/ $注射器/ modulerr P0 =应用&安培; P1 =错误%3A%20%... 2F%2F%2FF%3A%2Fworksapce%2Fangular%2Ftest%2Fjs%2Fangular.min.js%3A40%3A435)< / p>

的index.html

<div class="container">
    <div class="row">
    <div class="col-md-3">
        <ul class="nav">
            <li><a href="#AddOrders"> Add Order </a></li>
            <li><a href="#ShowOrders"> Show Order </a></li>
        </ul>
    </div>
    <div class="col-md-9">
        <div ng-view></div>
    </div>
    </div>
</div>
</script>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
<script src="controller/addcontrollers"></script>
<script src="controller/showcontrollers"></script>

2 个答案:

答案 0 :(得分:3)

他们需要是.js文件。 您尝试像节点一样加载它们: - )

<script src="controller/addcontrollers.js"></script>
<script src="controller/showcontrollers.js"></script>

答案 1 :(得分:1)

从html中删除这些脚本标记。

 <script src="controller/addcontrollers"></script>
 <script src="controller/showcontrollers"></script>

相反,您可以使用以下控制器:

  <div class="container" ng-controller="addcontrollers">
                OR      
  <div class="container" ng-controller="showcontrollers">