找不到错误:angular.js:38未捕获错误:[$ injector:nomod]

时间:2016-11-03 12:39:47

标签: angularjs

请帮助解决此错误。我无法解决这个问题。

\布局\ sidenav.controller.js

angular.module('app.layout', [])
.controller('SideNavController', SideNavController);

function SideNavController(){
  var vm = this;
  vm.name = "sideNav"
}

app.module.js

angular.module('app', [
  /* AngularJS modules */
  'ngMaterial',
  'ngSanitize',
  'ngAnimate'
    /* app.feature modules */
  'app.layout'
  /* cross.app modules */

])
.config();

angular.js:38未捕获错误:[$ injector:nomod] http://errors.angularjs.org/1.5.5/ $ injector / nomod?p0 = app(...)(匿名函数)@ angular.js:38(匿名函数)@angular。 js:2070b @ angular.js:1994(匿名函数)@ angular.js:2068(匿名函数)@ app.config.js:1 app.module.js:7 Uncaught SyntaxError:意外的字符串 angular.js:38未捕获错误:[$ injector:nomod] http://errors.angularjs.org/1.5.5/ $ injector / nomod?p0 = app(...)(匿名函数)@ angular.js:38(匿名函数)@ angular.js:2070b @ angular.js:1994(匿名函数)@ angular.js:2068(匿名函数)@ app.run.js:1 angular.js:38未捕获错误:[$ injector:modulerr] http://errors.angularjs.org/1.5.5/ $ injector / modulerr?p0 = app& p1 =错误%3A%20%... ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5 %2Fangular.min.js%3A21%3A332)(...)(匿名函数)@ angular.js:38(匿名函数)@ angular.js:4587q @ angular.js:322g @ angular.js:4548bb @ angular.js :4470c @ angular.js:1746yc @ angular.js:1767ee @ angular.js:1652(匿名函数)@ angular.js:30863b @ angular.js:3166Qf @ angular.js:3456d @ angular.js:3444

\ index.html的

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="/stylesheets/style.css" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="icon" href="data:;base64,iVBORw0KGgo=">

  <!-- Angular Material style sheet -->
  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
</head>
<body ng-app="app" ng-cloak>
<div ng-controller="SideNavController as vm">
<p>
  {{vm.name}}
</p>
</div>


<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
  <script csrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
  <script csrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
  <script csrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>

  <!-- Angular Material Library -->
  <script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-sanitize.min.js"></script>

 <!-- My application  -->
  <script src="layout/sidenav.controller.js"></script>
  <!-- <script src="layout/main-container.controller.js"></script> -->
  <script src="app.config.js"></script>
  <script src="app.module.js"></script>
  <script src="app.run.js"></script>
</body>
</html>

\ angular.config.js

angular.module('app')
.config(configure);

function configure() {

}

\ angular.run.js

angular.module('app')
.run(runBlock);
function runBlock() {

}

1 个答案:

答案 0 :(得分:1)

,

后,你错过了 ngAnimate
angular.module('app', [
  /* AngularJS modules */
  'ngMaterial',
  'ngSanitize',
  'ngAnimate',
    /* app.feature modules */
  'app.layout'
  /* cross.app modules */

])