-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathangularform.html
More file actions
41 lines (40 loc) · 1.16 KB
/
Copy pathangularform.html
File metadata and controls
41 lines (40 loc) · 1.16 KB
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
31
32
33
34
35
36
37
38
39
40
41
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-ng-submit-production</title>
<script src="//code.angularjs.org/snapshot/angular.min.js"></script>
</head>
<body ng-app="submitExample">
<script>
angular.module('submitExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.list = [];
$scope.name;
$scope.email;
$scope.phone;
$scope.submit = function() {
if ($scope.name, $scope.email, $scope.phone) {
$scope.list = [];
$scope.list.push(this.name, this.email, this.phone);
$scope.name;
$scope.email;
$scope.phone;
}
};
}]);
</script>
<form ng-submit="submit()" ng-controller="ExampleController">
Name :
<input name="name" type="text" ng-model="name" name="name" /><br/>
Email :
<input name="email" type="text" ng-model="email" name="email" /><br/>
Phone :
<input name="phone" type="text" ng-model="phone" name="phone" />
<input type="submit" id="submit" value="Submit" />
<ul>
<li ng-repeat="x in list"> {{x}} </li>
</ul>
</form>
</body>
</html>