-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
109 lines (108 loc) · 3.94 KB
/
index.html
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en" ng-app="studentApp">
<head>
<meta charset="UTF-8">
<title>Angular Application Hello Name</title>
<link href="bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container" ng-controller="StudentController">
<h1>Student Registration Form</h1>
<form name="studentForm" novalidate>
<div class="row">
<div class="col-md-6">
<div class="form-group"
ng-class="{ 'has-error': studentForm.firstName.$touched && studentForm.firstName.$invalid }">
<label class="control-label">First Name</label>
<input class="form-control"
name="firstName"
ng-model="student.firstName" placeholder="First Name"
required ng-minlength="5" ng-maxlength="10">
<div class="help-block" ng-messages="studentForm.firstName.$error"
ng-if="studentForm.firstName.$touched">
<p ng-message="minlength">Your name is too short.</p>
<p ng-message="maxlength">Your name is too long.</p>
<p ng-message="required">Your name is required.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label">Last Name</label>
<input type="text" name="lastName"
class="form-control"
ng-model="student.lastName">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label">DOB</label>
<input type="text"
class="form-control" name="dob"
ng-model="student.dob">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label">City</label>
<input type="text"
class="form-control" name="city"
ng-model="student.city">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label">Email</label>
<input type="email"
class="form-control" name="email"
ng-model="student.emailId">
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<input type="button"
class="btn btn-primary"
value="Submit"
ng-disabled="studentForm.$invalid"
ng-click="save()">
</div>
</div>
</form>
<hr>
<table class="table table-bordered">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>DOB</th>
<th>City</th>
<th>Email Id</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in students">
<td>{{item.firstName}}</td>
<td>{{item.lastName}}</td>
<td>{{item.dob}}</td>
<td>{{item.city}}</td>
<td>{{item.emailId}}</td>
<td><button class="btn btn-danger" ng-click="remove(item.emailId)">Delete</button></td>
</tr>
</tbody>
</table>
</div>
<script src="jquery-3.2.1.js"></script>
<script src="bootstrap.min.js"></script>
<script src="angular.min.js"></script>
<script src="angular-messages.min.js"></script>
<script src="student-angular.js"></script>
</body>
</html>