<div ng-app="myApp" ng-controller="myCtrl">
姓:<input type = "text" ng-model="lastName"><br>
名:<"input type= "text" ng-model="firstName"><br>
姓名:{{firstName+" "+lastName}}
<div>
<script>
var app = angular.model("myApp",[] );
app.controller("myCtrl",function( $scope ){
$scope.firstName = "John";
$scope.lastName = "Doe";
});
</script>
运行结果:(姓名值随框内元素变化而变化)