First version
[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     'SampleModule',
21     'UploadFiles',
22     'LinkButton',
23     'TokenRefresh',
24     'RangeSlider',
25     'ModalNotification'
26   ])
27     .config(config)
28     .run(run)
29   ;
30
31   config.$inject = ['$urlRouterProvider', '$locationProvider'];
32   
33   console.log ("***location=" + window.location + " search" + window.search);
34
35   function config($urlProvider, $locationProvider, AppConfig) {
36     $urlProvider.otherwise('/dashboard');
37
38     // https://docs.angularjs.org/error/$location/nobase
39     $locationProvider.html5Mode(true).hashPrefix('!');
40     
41   }
42
43   function run() {
44     FastClick.attach(document.body);
45   }
46   
47 // Fondation-app.template is not included correctly by gulp 
48 // Include here missing templates from foundation-apps/dist/js/foundation-apps-templates.js
49 angular.module('foundation').run(['$templateCache', function($templateCache) {
50   $templateCache.put('components/modal/modal.html',
51     '<div\n' +
52     '  class="modal-overlay"\n' +
53     '  ng-click="hideOverlay()">\n' +
54     '  <aside\n' +
55     '    class="modal"\n' +
56     '    ng-click="$event.stopPropagation();"\n' +
57     '    ng-transclude>\n' +
58     '  </aside>\n' +
59     '</div>\n' +
60     '');
61 }]);
62
63 console.log ("opa=@@APPNAME@@ Loaded");
64 })();