实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<script src= "https://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
4
<body>
5
6
<p>尝试修改以下表单。</p>
7
8
<div ng-app="myApp" ng-controller="myCtrl">
9
10
名: <input type="text" ng-model="firstName"><br>
11
姓: <input type="text" ng-model="lastName"><br>
12
<br>
13
姓名: {{firstName + " " + lastName}}
14
15
</div>
16
17
<script>
18
var app = angular.module('myApp', []);
19
app.controller('myCtrl', function($scope) {
20
    $scope.firstName= "John";
21
    $scope.lastName= "Doe";
22
});
23
</script>
24
25
</body>
26
</html>
27