summaryrefslogtreecommitdiffstats
path: root/f/scripts/client.js
diff options
context:
space:
mode:
authorokalintu <ilkka.oksanen@aalto.fi>2015-03-03 15:46:01 +0200
committerokalintu <ilkka.oksanen@aalto.fi>2015-03-03 15:46:01 +0200
commit10eb4471ab820bb2323077cb7be8029a2e9b0759 (patch)
tree0d3b77b065d46bd9657359d7e33f7e4c2881c323 /f/scripts/client.js
parent6cb2891f117e29ea7adc68f62fe422285fc8364b (diff)
sanitized routes
Diffstat (limited to 'f/scripts/client.js')
-rw-r--r--f/scripts/client.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/f/scripts/client.js b/f/scripts/client.js
new file mode 100644
index 0000000..fb612ed
--- /dev/null
+++ b/f/scripts/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","");
+ };
+
+});