未捕获的错误:[$ injector:modulerr]无法实例化模块

时间:2015-06-17 12:22:23

标签: angularjs

我收到错误:

Uncaught Error: [$injector:modulerr] Failed to instantiate module msgsSystemDisplay due to: Error: [$injector:nomod] Module 'msgsSystemDisplay' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

并且我不知道为什么,尤其是当另一个jshtml文件中的另一个模块完全正常工作时。



(function() {

  var displayApp = angular.module('msgsSystemDisplay', []);

});

<!DOCTYPE html>
<html ng-app="msgsSystemDisplay">

<head lang="en">
  <meta charset="UTF-8">
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
  <script src="http://code.angularjs.org/1.3.10/angular.js"></script>
  <link rel='stylesheet' href='../stylesheets/index.css' />
  <script src="../javascripts/displayApp.js"></script>
  <title></title>
</head>

<body>
</body>

</html>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

您没有调用IIFE

(function() {

  var displayApp = angular.module('msgsSystemDisplay', []);

}());