我是angular.js的新手,我的第一次嘗試真的很糟糕。 我得到一個錯誤,我試圖調試它,但現在我有點沮喪。 錯誤是
angular.js:38Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.6/$injector/modulerr?p0=myapp&p1=Error%3A%2…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.6%2Fangular.min.js%3A21%3A19)(anonymous function) @ angular.js:38(anonymous function) @ angular.js:4630q @ angular.js:322g @ angular.js:4591db @ angular.js:4513c @ angular.js:1777Ac @ angular.js:1798fe @ angular.js:1683(anonymous function) @ angular.js:31018b @ angular.js:3197Rf @ angular.js:3487d @ angular.js:3475
這是我的代碼爲:
的index.html
<!DOCTYPE html>
<html lang="en" ng-app="myapp">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<title>User Story</title>
</head>
<script src="../app.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular-route.min.js"></script>
<body>
<h1>Hello Baby Users</h1>
{{2+2}}
</body>
</html>
和: app.js
angular.module('myapp',[]);
把你的腳本app.js下方角route.min.js,希望它會工作 –