aboutsummaryrefslogtreecommitdiffstats
path: root/demo-ui/app/controllers/MainController.js
diff options
context:
space:
mode:
Diffstat (limited to 'demo-ui/app/controllers/MainController.js')
-rw-r--r--demo-ui/app/controllers/MainController.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/demo-ui/app/controllers/MainController.js b/demo-ui/app/controllers/MainController.js
new file mode 100644
index 0000000..199048b
--- /dev/null
+++ b/demo-ui/app/controllers/MainController.js
@@ -0,0 +1,31 @@
+// Create our module
+var app = angular.module("vcpe", []);
+
+(function() {
+var MainController = function($http, $log, cosServices, eplServices, mefServices, model, dbg ) {
+
+ dbg.p("---> in MainController()");
+
+ // config our app
+ var cfgFile = "../config.json";
+ $http.get(cfgFile).
+ success(function(data) {
+ dbg.p("in cfgFile read callback");
+ dbg.p("incoming data");
+ dbg.pj(data);
+ cosServices.setCosUrl(data.cosMgr);
+ eplServices.setEplUrl(data.eplMgr);
+ mefServices.setEvcUrl(data.evcMgr);
+ mefServices.setUniUrl(data.uniMgr);
+ mefServices.setEvcPathUrl(data.evcPathMgr);
+ model.setAvailableUnis(data.uniList);
+ }).
+ error(function() {
+ dbg.e("Could not read " + cfgFile);
+ });
+};
+
+// register controller in the module
+app.controller("MainController", MainController);
+
+}()); \ No newline at end of file