-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path39a.html
More file actions
30 lines (25 loc) · 666 Bytes
/
Copy path39a.html
File metadata and controls
30 lines (25 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="personCtrl">
First Name: <input type="text" ng-model="person.firstName"><br>
Last Name: <input type="text" ng-model="person.lastName"><br>
<br>
Full Name: {{fullName()}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller("personCtrl",function($scope) {
$scope.person = {
firstName: "John",
lastName: "Doe",
};
$scope.fullName = function() {
var x = $scope.person;
return x.firstName + " " + x.lastName;
};
});
</script>
</body>
</html>