我正在尝试关注AngularJS基础知识的PluralSight课程.这个人的代码和我的代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Hello World</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<header>
<h1 ng-controller="HelloWorldCtrl">{{helloMessage}}</h1>
</header>
<section>
</section>
<footer>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<script type="text/javascript">
function HelloWorldCtrl($scope) {
$scope.helloMessage = "Hello World";
}
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
然而它对他有用,而不适合我!我究竟做错了什么?对我来说似乎是一个非常简单的设置,但它对我不起作用.我没有得到Hello World,而是得到:
{{helloMessage}}
任何帮助将不胜感激.
| 归档时间: |
|
| 查看次数: |
4458 次 |
| 最近记录: |