Continue separation of sources and put also html5 into separated dir
[staging/xdg-launcher.git] / templates / hybrid-html5 / 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     'SampleHomeModule',
30     'LinkButton',
31     'TokenRefresh',
32     'RangeSlider',
33     'ModalNotification'
34   ])
35     .value ('urlquery', ParseQueryString())
36     .config(config)
37     .run(run)
38   ;
39
40   config.$inject = ['$urlRouterProvider', '$locationProvider'];
41   
42   function config($urlProvider, $locationProvider, AppConfig) {
43     $urlProvider.otherwise('/sample-home');
44
45     // https://docs.angularjs.org/error/$location/nobase
46     $locationProvider.html5Mode(true).hashPrefix('!');
47     
48   }
49
50   function run() {
51     FastClick.attach(document.body);
52   }
53
54 console.log ("opa=@@APPNAME@@ Loaded");
55 })();