今天学习 AngularJS 之 Hello world !
打开你喜欢的任意一款编辑器, 编写文件angularjs.html,输入以下内容
打开你喜欢的任意一款编辑器, 编写文件angularjs.html,输入以下内容
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script >
function bobcontroller($scope){
$scope.name = 'bob';
}
</script>
</head>
<body ng-controller="bobcontroller">
Hello {{name}}
</body>
</html>
用任意一款浏览器打开 angularjs.html, 看到了什么?
Hello bob 对不对
收工!
Hello bob 对不对
收工!