1d8fc2e3b53a7a051965f5e850825b157e4dacbd
[src/app-framework-demo.git] / afm-client / app / Frontend / app.js
1 (function() {
2   'use strict';
3
4   angular.module('@@APPNAME@@', [ // Warning: Appname should fit with gulpfile.js & index.html
5     'ui.router',
6     'ngAnimate',
7
8     //foundation
9     'foundation',
10     'foundation.dynamicRouting',
11     'foundation.dynamicRouting.animations',
12     
13     // external components
14     'ui-notification',
15     
16     // Application Components
17     'AppConfig',
18     'JQueryEmu',
19     'DashboardModule',
20     'UploadFiles',
21     'LinkButton',
22     'TokenRefresh',
23     'RangeSlider',
24     'ModalNotification'
25   ])
26     .config(config)
27     .run(run)
28   ;
29
30   config.$inject = ['$urlRouterProvider', '$locationProvider'];
31   
32   console.log ("***location=" + window.location + " search" + window.search);
33
34   function config($urlProvider, $locationProvider, AppConfig) {
35     $urlProvider.otherwise('/dashboard');
36
37     // https://docs.angularjs.org/error/$location/nobase
38     $locationProvider.html5Mode(true).hashPrefix('!');
39     
40   }
41
42   function run() {
43     FastClick.attach(document.body);
44   }
45   
46 // Fondation-app.template is not included correctly by gulp 
47 // Include here missing templates from foundation-apps/dist/js/foundation-apps-templates.js
48 angular.module('foundation').run(['$templateCache', function($templateCache) {
49   $templateCache.put('components/modal/modal.html',
50     '<div\n' +
51     '  class="modal-overlay"\n' +
52     '  ng-click="hideOverlay()">\n' +
53     '  <aside\n' +
54     '    class="modal"\n' +
55     '    ng-click="$event.stopPropagation();"\n' +
56     '    ng-transclude>\n' +
57     '  </aside>\n' +
58     '</div>\n' +
59     '');
60 }]);
61
62 console.log ("opa=@@APPNAME@@ Loaded");
63 })();