4 // WARNING: make sure than app/frontend/services/AppConfig.js match your server
6 // list all rependencies within the page + controler if needed
7 angular.module('SampleHomeModule', ['SubmitButton', 'TokenRefresh','ModalNotification'])
9 .controller('SampleHomeController', function (AppCall, Notification) {
10 var scope = this; // I hate JavaScript
14 scope.status ="err-no";
16 console.log ("Home Controller");
18 scope.OnResponse= function(jresp, errcode) {
20 // Update UI response global display zone
21 scope.status = jresp.request.status;
22 scope.errcode = errcode;
23 scope.request = jresp.request;
24 scope.response = jresp.response;
26 var action=jresp.request.reqid.toUpperCase();
33 Notification.error ({message: "Invalid RequestID:" + jresp.request.reqid , delay: 5000});
37 // update button classes within home.html
38 scope.class [jresp.request.reqid]="success";
39 console.log ("OK: "+ JSON.stringify(jresp));
42 scope.ProcessError= function(response, errcode, config) {
43 Notification.error ({message: "Invalid API:" + response.request.reqid , delay: 5000});
44 scope.status = "err-fx";
45 scope.errcode = errcode;
46 scope.request = response.request;
48 console.log ("FX: "+ JSON.stringify(response));
51 scope.RefreshSession = function() {
52 console.log ("RefreshSession");
53 AppCall.get ("xxxxxx", "ping", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
56 scope.Initialised = function () {
57 scope.class = {connect: "success"};
62 console.log ("SampleControler Loaded");