无法在角度中加载新模块依赖项

时间:2015-01-25 13:06:06

标签: javascript angularjs carousel steroids

我使用appgyver并且无法加载新模块。我收到此错误消息:由于以下原因无法实例化模块legeApp:\ n [$ injector:nomod]模块'legeApp'不可用!您要么错误拼写了模块名称,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数

这是我的代码,请帮助!

Js文件

angular
  .module('legeApp', ['angular-carousel'])
  .controller('IndexControllerOrer', function($scope, supersonic, $filter) {  

});

我的Layout.html

<html>
<head>
  <meta charset="utf8">
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

  <title><%= yield.viewName %></title>

  <link rel="stylesheet" href="/components/supersonic/css/supersonic.css" />
  <link rel="stylesheet" href="/app/common/stylesheets/application.css" />
  <link rel="import" href="/components/supersonic/components/import.html">
  <link href="/components/angular-carousel/angular-carousel.css" rel="stylesheet" type="text/css" />


  <script src="/components/angular-carousel/angular-carousel.js"></script>
  <script src="http://localhost/cordova.js"></script>
  <script src="/components/steroids-js/steroids.js"></script>
  <script src="/components/angular/angular.js"></script>
  <script src="/components/supersonic/supersonic.js"></script>
  <script src="/components/webcomponentsjs/webcomponents.js"></script>

  <% _.each(yield.modules, function(module) { %>
  <script src="/app/<%= module %>.js"></script>
  <% }); %>
</head>
<body ng-app="<%= yield.moduleName %>">

<%= yield.view %>

</body>
</html>

我的观点

<div ng-controller="IndexControllerOrer">

  <super-navbar>
    <super-navbar-title>
      Helseplager
    </super-navbar-title>
  </super-navbar>

          <ul class="list" rn-carousel>
            <li ng-repeat="plagerOret in plagerOret" class="item item-checkbox checkbox-assertive"  >
             <label class="checkbox">
               <input type="checkbox" ng-model="plagerOret.checked">
             </label >
              {{plagerOret.value}}
            </li>
          </ul>


<button class="button button-block button-assertive" ng-click="checkValues()" value="checkitems" >
  Diagonoser
</button>

</div>

angular-carousel文件位于components / angular-carousel / angular-carousel.css和components / angular-carousel / angular-carousel.js

1 个答案:

答案 0 :(得分:1)

您的javascript中存在语法错误。它应该是:

angular
  .module('legeApp', ['angular-carousel'])
  .controller('IndexControllerOrer', function($scope, supersonic, $filter) {      
  });