91a8a729ccbf86cd0665237c1012699c75b6cfd4
[src/app-framework-demo.git] / afb-client / app / Frontend / app.js
1 (function() {
2   'use strict';
3   
4   function  ParseQueryString () {
5       var qd = {};
6       location.search.substr(1).split("&").forEach(function(item) {
7           var k = item.split("=")[0];
8           var v = decodeURIComponent(item.split("=")[1]); 
9           if (k in qd) qd[k].push(v); else qd[k] = [v];
10       });
11       return qd;
12   }
13
14   angular.module('@@APPNAME@@', [ // Warning: Appname should fit with gulpfile.js & index.html
15     'ui.router',
16     'ngAnimate',
17
18     //foundation
19     'foundation',
20     'foundation.dynamicRouting',
21     'foundation.dynamicRouting.animations',
22     
23     // external components
24     'ui-notification',
25     
26     // Application Components
27     'AppConfig',
28     'JQueryEmu',
29     'HomeModule',
30     'SampleModule',
31     'UploadFiles',
32     'LinkButton',
33     'TokenRefresh',
34     'RangeSlider',
35     'ModalNotification'
36   ])
37     .value ('urlquery', ParseQueryString())
38     .config(config)
39     .run(run)
40   ;
41
42   config.$inject = ['$urlRouterProvider', '$locationProvider'];
43   
44   function config($urlProvider, $locationProvider, AppConfig) {
45     $urlProvider.otherwise('/home');
46
47     // https://docs.angularjs.org/error/$location/nobase
48     $locationProvider.html5Mode(true).hashPrefix('!');
49     
50   }
51
52   function run() {
53     FastClick.attach(document.body);
54   }
55
56 console.log ("opa=@@APPNAME@@ Loaded");
57 })();