-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
135 lines (126 loc) · 6.38 KB
/
index.html
File metadata and controls
135 lines (126 loc) · 6.38 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!doctype html>
<html lang="en" ng-app="myapp">
<head>
<meta charset="utf-8">
<title>Angular JS simple application</title>
<link rel="stylesheet" href="css/bootstrap.css"/>
</head>
<body ng-controller="myController">
<div class="col-md-8 col-md-offset-2" style="margin-top: 10px">
<h1 class="center-block text-center bg-info"> Welcome to my angular sample</h1>
<div class="alert alert-dismissable alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
This is the sample project using AngularJS for tutorial purpose
</div>
</div>
<div class="col-md-8 col-md-offset-2">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>Mobile</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="cus in customers">
<td>{{cus.name}}</td>
<td>{{cus.address}}</td>
<td>{{cus.mobile}}</td>
<td><input type="button" class="btn btn-default" value="View" ng-click="viewCustomer(cus)" data-toggle="modal" data-target="#modal_popup" /></td>
<td><input type="button" class="btn btn-default" value="Edit" ng-click="editCustomer(cus)" data-toggle="modal" data-target="#modal_popup" /></td>
</tr>
</tbody>
<tfoot>
<tr><td colspan="4"><input type="button" class="btn btn-default" value="Create new" ng-click="newCustomer()" data-toggle="modal" data-target="#modal_popup" /></td></tr>
</tfoot>
</table>
</div>
<!-- POPUP-Modal -->
<div class="modal fade" id="modal_popup" ng-switch on="customer.state">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" ng-switch-when="edit">Edit</h4>
<h4 class="modal-title" ng-switch-when="view">View</h4>
<h4 class="modal-title" ng-switch-default>Create New Customer</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" ng-switch-when="edit">
<div class="form-group">
<label for="name" class="col-lg-2 control-label">Name</label>
<div class="col-lg-10">
<input class="form-control" id="name" placeholder="Name" type="text" ng-model="customer.name">
</div>
</div>
<div class="form-group">
<label for="address" class="col-lg-2 control-label">Address</label>
<div class="col-lg-10">
<input class="form-control" id="address" placeholder="Name" type="text" ng-model="customer.address">
</div>
</div>
<div class="form-group">
<label for="mobile" class="col-lg-2 control-label">Mobile</label>
<div class="col-lg-10">
<input class="form-control" id="mobile" placeholder="Name" type="text" ng-model="customer.mobile">
</div>
</div>
</form>
<div class="list-group" ng-switch-when="view">
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">Name</h4>
<p class="list-group-item-text">{{customer.name}}</p>
</a>
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">Address</h4>
<p class="list-group-item-text"></p>
</a>
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">Mobile</h4>
<p class="list-group-item-text">{{customer.mobile}}</p>
</a>
</div>
<form class="form-horizontal" ng-switch-default>
<div class="form-group">
<label for="name" class="col-lg-2 control-label">Name</label>
<div class="col-lg-10">
<input class="form-control" id="name" placeholder="Name" type="text" ng-model="customer.name">
</div>
</div>
<div class="form-group">
<label for="address" class="col-lg-2 control-label">Address</label>
<div class="col-lg-10">
<input class="form-control" id="address" placeholder="Address" type="text" ng-model="customer.address">
</div>
</div>
<div class="form-group">
<label for="mobile" class="col-lg-2 control-label">Mobile</label>
<div class="col-lg-10">
<input class="form-control" id="mobile" placeholder="Mobile" type="text" ng-model="customer.mobile">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" ng-click="addCustomer(customer);">Save changes</button>
</div>
</div>
</div>
</div>
<!-- In production use:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js"></script>
-->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/angular/angular.min1.22.js"></script>
<script src="lib/bootstrap/bootstrap.js"></script>
<script src="js/models.js"></script>
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
<script src="js/filters.js"></script>
<script src="js/directives.js"></script>
</body>
</html>