我收到错误:
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.
并且我不知道为什么,尤其是当另一个js
和html
文件中的另一个模块完全正常工作时。
(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;
答案 0 :(得分:1)
您没有调用IIFE
(function() {
var displayApp = angular.module('msgsSystemDisplay', []);
}());