Angular无法加载我的app模块

时间:2016-07-17 00:00:45

标签: javascript angularjs

在加载应用程序模块时遇到一些问题,请帮助,如果需要更多代码请告诉我。提前谢谢。

的index.html

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/
1.5.7/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/
1.5.7/angular-route.js"></script> 
<script type="text/javascript" src="/app/app.js"></script>  
<script src="/app/trading/controllers/members-controller.js"></script>
<script src="/app/components/paginate/paginate-filter.js"></script>
<script src="/app/trading/services/trading-service.js"></script>

app.js

angular.module("nkApp", [
  'ngRoute',
  'ngResource',
  'nkApp.members',
  'nkApp.paginate-filter',
  'nkApp.tradingService'
]).
  config(['$routeProvider', function($routeProvider){
    $routeProvider.
      when("/", {
        templateUrl: "/app/trading/members/members-view.html",
        controller: "membersController"
      }).
      when("/trading-api/members/:id", {
        templateUrl: "app/trading/members/member.html",
        controller: "membersController"
      }).
      when("/trading-api/members/:username", {
        templateUrl: "app/trading/members/member.html",
        controller: "membersController"
      }).
      otherwise({redirectTo: "/"});
  }]);

删除ngResource后的控制台错误

http://errors.angularjs.org/1.5.7/$injector/modulerr?p0=nkApp&p1=%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.7%2F%24injector%2Fmodulerr%3Fp0%3DnkApp.members%26p1%3D%255B%2524injector%253Amodulerr%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.5.7%252F%2524injector%252Fmodulerr%253Fp0%253Dui.bootstrap%2526p1%253D%25255B%252524injector%25253Anomod%25255D%252520http%25253A%25252F%25252Ferrors.angularjs.org%25252F1.5.7%25252F%252524injector%25252Fnomod%25253Fp0%25253Dui.bootstrap%25250AO%25252F%25253C%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A6%25253A412%25250Ale%25252F%25253C%25252F%25253C%25252F%25253C%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A25%25253A72%25250Ab%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A24%25253A115%25250Ale%25252F%25253C%25252F%25253C%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A24%25253A358%25250Ag%25252F%25253C%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A39%25253A374%25250Ar%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A7%25253A353%25250Ag%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A39%25253A222%25250Ag%25252F%25253C%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A39%25253A391%25250Ar%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A7%25253A353%25250Ag%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A39%25253A222%25250Ag%25252F%25253C%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A39%25253A391%25250Ar%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A7%25253A353%25250Ag%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A39%25253A222%25250Adb%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A43%25253A246%25250ABc%25252Fc%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252Fangular.min.js%25253A20%25253A359%25250ABc%252540https%25253A%25252F%25252Fajax.googleapis.com%25252Fajax%25252Flibs%25252Fangularjs%25252F1.5.7%25252F

1 个答案:

答案 0 :(得分:0)

你试图在没有脚本的情况下注入 ngResource

只需将其添加到 HTML

即可
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.7/angular-resource.js"></script>