diff options
| author | okalintu <ilkka.oks4nen@gmail.com> | 2015-03-03 13:49:21 +0200 |
|---|---|---|
| committer | okalintu <ilkka.oks4nen@gmail.com> | 2015-03-03 13:49:21 +0200 |
| commit | c3f11b89b73e1e1e109631493150817bd8c78a66 (patch) | |
| tree | 3293a1f76d7c4093e785eb89bbc3178ad3b1890c /client.js | |
initial commit
Diffstat (limited to 'client.js')
| -rw-r--r-- | client.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/client.js b/client.js new file mode 100644 index 0000000..fb612ed --- /dev/null +++ b/client.js @@ -0,0 +1,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",""); + }; + +}); |
