Angularjs 角度控制器
伙计们,请检查我下面的代码,为什么它不工作Angularjs 角度控制器,angularjs,Angularjs,伙计们,请检查我下面的代码,为什么它不工作 <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body ng-app> <h1 ng-controller="HWCtrl">{{helloMessage}}<
<!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>
我为ng控制器创建了HWCtrl函数。。提前感谢您拼错了脚本:
什么不起作用请具体说明?angular.js文件的路径是否正确。您的代码工作正常,正如在这里看到的,这个问题似乎是离题的,因为它是关于打字错误的
<srcipt src="angular.js"></srcipt>
^-- here ^-- and here