diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2015-12-20 21:04:34 +0100 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2015-12-20 21:04:34 +0100 |
commit | 4136c1506e0c894e604ec069339313987a7e05e7 (patch) | |
tree | 1276966f93dce30949e78d4aef456223dea71b48 /afb-client/app/Frontend/pages/Sample/SampleModule.js | |
parent | 07eb8e102607da8d6a4c1cd9835e8465c9280161 (diff) |
Implemented client upload with rangeslider and zip open
Diffstat (limited to 'afb-client/app/Frontend/pages/Sample/SampleModule.js')
-rw-r--r-- | afb-client/app/Frontend/pages/Sample/SampleModule.js | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/afb-client/app/Frontend/pages/Sample/SampleModule.js b/afb-client/app/Frontend/pages/Sample/SampleModule.js index 2a2e777..8ae82ea 100644 --- a/afb-client/app/Frontend/pages/Sample/SampleModule.js +++ b/afb-client/app/Frontend/pages/Sample/SampleModule.js @@ -2,46 +2,16 @@ 'use strict'; // list all rependencies within the page + controler if needed -angular.module('SampleModule', ['SubmitButton','UploadFile']) +angular.module('SampleModule', ['SubmitButton','UploadFiles']) .controller('SampleController', function ($http) { - var self = this; // I hate JavaScript - this.status='muted-off'; + var scope = this; // I hate JavaScript - console.log ("sample controller"); - - this.MuteOn = function() { - console.log ("Muted"); - // send AJAX request to server - var handler = $http.post('/api/dbus/ping', {type:'mute', action: "on"}); - - handler.success(function(response, errcode, headers, config) { - self.status = 'muted-on'; - }); - - handler.error(function(status, errcode, headers) { - console.log ("Oops /api/dbus/pring err=" + errcode); - self.status = 'muted-error'; - }); - }; + console.log ("sample Init"); - this.MuteOff = function() { - console.log ("UnMuted"); - // send AJAX request to server - var handler = $http.post('/api/dbus/ping', {type:'mute', action: "off"}); - - handler.success(function(response, errcode, headers, config) { - self.status = 'muted-off'; - }); - - handler.error(function(status, errcode, headers) { - console.log ("Oops /api/dbus/ping err=" + errcode); - self.status = 'muted-error'; - }); - + scope.FileUploaded = function (response) { + console.log ("FileUploaded response=%s", JSON.stringify(response)); }; - - }); console.log ("SampleControler Loaded"); |