大家好,谢谢你的帮助。
这里是模板
<!DOCTYPE html>
<html ng-app="projectApp">
<head>
<meta charset="UTF-8" />
<title>Planning Poker !</title>
<script src="resources/static/js/angular-1.2.21/angular.js"></script>
<script src="resources/static/js/controllers.js"></script>
</head>
<body>
<header>Planning Poker</header>
<nav>
<ul>
<li>Add a Project</li>
<li>The Project List</li>
<li>About</li>
</ul>
</nav>
<section>
<div ng-controller="GreetingController">
{{ greeting }}
</div>
<!--<form method="post" action="">
<p><input type="text" placeholder="Name!"></p>
<p><input type="text" placeholder="Mail!"></p>
<p><input type="text" placeholder="Password!"></p>
</form>-->
</section>
<footer></footer>
</body>
</html>
和控制器:
var projectApp = angular.module('projectApp', []);
projectApp.controller('GreetingController', ['$scope', function($scope) {
$scope.greeting = 'Hola!';
}]);
并且,目录结构。
http://i.stack.imgur.com/fWORv.png
结果是
http://i.stack.imgur.com/qfuHg.png
但我希望“Hola!”而不是“{{greeting}}”
答案 0 :(得分:0)
它没有看到angular.js,尝试获取在线版本,用“https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js”替换你的angular.js src
答案 1 :(得分:0)
好的问题已解决。这是一个脚本问题。
<script src="js/angular-1.2.21/angular.js"></script>
<script src="js/controllers.js"></script>
确实,它被直接映射到&#34; js&#34; 。目录