summaryrefslogtreecommitdiffstats
path: root/client.js
blob: fb612ed7c9460fa11a1224ad56bd529cd46d4af6 (plain)
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
var ioc = angular.module('ioc',[]);

ioc.controller('ioctrl',function($scope){
	var soc= io();
	$scope.que=[];
	$scope.row="";
	$scope.name="";
	$scope.qsize=0;
	
	$scope.submit = function(){
		soc.emit("queadd",{"row":$scope.row,"name":$scope.name});
		$scope.row="";
		$scope.name="";
	};
	
	soc.on("quedata",function(data){
		$scope.que=data;
		$scope.qsize=data.length;
		$scope.$apply();
	});

	$scope.popfirst = function(){
		soc.emit("quepopfirst","");	
	};

});