2013-08-20 142 views
-5

家伙请检查我下面的代码,为什么它不工作..AngularJS NG-控制器

<!doctype html> 
<html> 
<head>   
     <meta charset="utf-8"> 
     <title></title> 
</head> 
<body ng-app> 
     <h1 ng-controller="HWCtrl">{{helloMessage}}</h1> 

     <srcipt src="angular.js"></srcipt> 
     <script type="text/javascript">     
       function HWCtrl($scope) { 
        $scope.helloMessage = 'Hello World'; 
       } 

     </script> 
</body> 

我创建HWCtrl功能的NG-控制器..提前

感谢
+3

什么不工作请具体? –

+0

正确的angular.js文件的路径。你的代码在[jsbin](http://jsbin.com/ewaY/1/edit) –

+2

上看到的效果很好,这个问题似乎是无关紧要的,因为它是关于错字 – Stewie

回答

4

你拼写错误script

<srcipt src="angular.js"></srcipt> 
    ^-- here     ^-- and here