-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtutorial.html
More file actions
69 lines (53 loc) · 2.15 KB
/
tutorial.html
File metadata and controls
69 lines (53 loc) · 2.15 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
<!DOCTYPE html>
<html>
<head>
<title>INFSCI 2711 Web Tutorial</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body style="margin: 60px;">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>This is INFSCI 2711 Tutorial on Web Applicaiton with RESTful API <br/><small>(with twitter bootstrap and knockouy.js)</small></h1>
</div>
<div id="personsContainer">
<h3>
There are <span data-bind="text: people().length"></span> persons in our databases.
<button class="btn btn-default" data-bind="click: findAll">Refresh</button>
</h3>
<form class="form-inline">
<!-- ko with: newPerson -->
<input class="form-control" placeholder="Enter first name" data-bind="textInput: firstName">
<input class="form-control" placeholder="Enter last name" data-bind="textInput: lastName">
<!-- /ko -->
<button type="submit" class="btn btn-default" data-bind="click: addPerson">Add Person</button>
</form>
<!-- ko if: people().length > 0 -->
<table class="table table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody data-bind="foreach: people">
<tr>
<td data-bind="text: $index"></td>
<td data-bind="text: firstName"></td>
<td data-bind="text: lastName"></td>
</tr>
</tbody>
</table>
<!-- /ko -->
</div>
</div>
</div>
<script type="text/javascript" src="javascripts/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="javascripts/bootstrap.min.js"></script>
<script type="text/javascript" src="javascripts/knockout-3.2.0.js"></script>
<script type="text/javascript" src="javascripts/knockout_models/personViewModel.js"></script>
</body>
</html>