<!DOCTYPE html>
<!--调用模块-->
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<script src="js/angular.js"></script>
<title>Title</title>
</head>
<body>
<!--调用控制器-->
<div ng-controller="myCtrl">
<!--调用作用域中的变量-->
<p ng-bind="name"></p>
</div>
<script>
/*声明一个模块*/
var app = angular.module('myApp', ['ng']);
/*声明一个控制器*/
app.controller('myCtrl', ["$scope",function ($scope) {
/*在作用域中声明一个变量name*/
$scope.name='Lilei'
}])
</script>
</body>
</html>