4 // list all rependencies within the page + controler if needed
5 angular.module('SampleModule', ['SubmitButton','UploadFile'])
7 .controller('SampleController', function ($http) {
8 var self = this; // I hate JavaScript
9 this.status='muted-off';
11 console.log ("sample controller");
13 this.MuteOn = function() {
14 console.log ("Muted");
15 // send AJAX request to server
16 var handler = $http.post('/api/dbus/ping', {type:'mute', action: "on"});
18 handler.success(function(response, errcode, headers, config) {
19 self.status = 'muted-on';
22 handler.error(function(status, errcode, headers) {
23 console.log ("Oops /api/dbus/pring err=" + errcode);
24 self.status = 'muted-error';
28 this.MuteOff = function() {
29 console.log ("UnMuted");
30 // send AJAX request to server
31 var handler = $http.post('/api/dbus/ping', {type:'mute', action: "off"});
33 handler.success(function(response, errcode, headers, config) {
34 self.status = 'muted-off';
37 handler.error(function(status, errcode, headers) {
38 console.log ("Oops /api/dbus/ping err=" + errcode);
39 self.status = 'muted-error';
47 console.log ("SampleControler Loaded");