html结构
<!DOCTYPE html>
<html>
<head>
<Meta charset="utf-8">
<Meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<div ng-app="myApp" ng-controller="personCtrl">
<p>姓名为{{lastName | uppercase}}</p>
</div>
</body>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script src="personController.js"></script>
</html>
js脚本
var app = angular.module("myApp",[]);
app.controller("personCtrl",function($scope){
$scope.firstName = "John";
$scope.lastName = "Doe";
$scope.fullName = function(){
return $scope.firstName + " " + $scope.lastName;
}
});