-
Notifications
You must be signed in to change notification settings - Fork 0
/
socket-angular.html
52 lines (49 loc) · 2.45 KB
/
socket-angular.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<title>Angular Socket.IO</title>
</head>
<body ng-app="myApp" ng-controller="MyCtrl">
<div class="container">
{{user}}
<input type="checkbox" ng-model="editMode">
<table class="table">
<thead>
<tr>
<th>Prénom</th>
<th>Nom</th>
<th>Email</th>
<th>Selected By</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="contact in contacts" ng-click="selectContact(contact)">
<td>
<span contenteditable model="contact.first_name" callback="sendUpdateToSocket(contact)" ng-hide="editMode"></span>
<input type="text" ng-show="editMode" ng-model="contact.first_name" ng-change="sendUpdateToSocket(contact)">
</td>
<td>
<span ng-hide="editMode">{{contact.last_name}}</span>
<input type="text" ng-show="editMode" ng-model="contact.last_name" ng-change="sendUpdateToSocket(contact)">
</td>
<td>
<span ng-hide="editMode">{{contact.email}}</span>
<input type="text" ng-show="editMode" ng-model="contact.email" ng-change="sendUpdateToSocket(contact)">
</td>
<td>
<span>{{printSelectedBy(contact)}}</span>
</td>
</tr>
</tbody>
</table>
</div>
<script src="/socket.io/socket.io.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script src="socket-angular.js"></script>
</body>
</html>