angular js 튜토리얼의 비디오를 실행 중입니다. 모듈을 만드는 데 문제가 있습니다.
내가 얻는 오류는 다음과 같습니다.
Failed to instantiate module myalcoholist due to:
Error: [$injector:nomod] http://errors.angularjs.org/1.4.8/$injector/nomod?p0=myal...
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:6:416
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:24:186
at b (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:23:251)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:23:494
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:38:117
at n (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:7:333)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:37:488)
at eb (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:41:249)
at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:19:463
내 코드는 깨끗하고 내가 가진 것은 모듈 생성뿐입니다.
이것은 html입니다.
<html ng-app="myalcoholist">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc= sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha256-Sk3nkD6mLTMOF0EOpNtsIry+s1CsaqQC1rVLTAy+0yc= sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
<script src="model/app.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
내 model / app.js에는 다음 코드가 포함되어 있습니다.
(function(){
var app = angular.module('myalcoholist',[]);
})
이 오류가 발생하는 이유는 무엇입니까? 문제에 관한 어떤 아이디어라도 대단히 감사하겠습니다.
감사
함수를 정의했지만 호출하지 않았습니다. 이 시도
(function(){
var app = angular.module('myalcoholist',[]);
})()
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다