diff options
Diffstat (limited to 'f/scripts/client.js')
| -rw-r--r-- | f/scripts/client.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/f/scripts/client.js b/f/scripts/client.js index fb612ed..546aa57 100644 --- a/f/scripts/client.js +++ b/f/scripts/client.js @@ -2,13 +2,16 @@ var ioc = angular.module('ioc',[]); ioc.controller('ioctrl',function($scope){ var soc= io(); + var pw =0; + + $scope.uid =0; $scope.que=[]; $scope.row=""; $scope.name=""; $scope.qsize=0; $scope.submit = function(){ - soc.emit("queadd",{"row":$scope.row,"name":$scope.name}); + soc.emit("queadd",{"row":$scope.row,"name":$scope.name,"uid":$scope.uid}); $scope.row=""; $scope.name=""; }; @@ -19,8 +22,20 @@ ioc.controller('ioctrl',function($scope){ $scope.$apply(); }); + soc.on("userinfo",function(data){ + $scope.uid = data.uid; + pw= data.pw; + }); + + soc.on("err",function(err){ + console.log("error! msg: "+err.msg); + }); + $scope.popfirst = function(){ soc.emit("quepopfirst",""); }; - + $scope.querm = function(qid){ + data = {"qid":qid,"pw":pw}; + soc.emit("quedelete",data); + }; }); |
