Bruno

Moving app.js & mainCtrl.js

1 -'use strict';  
2 -  
3 -/**  
4 - * @ngdoc overview  
5 - * @name newappApp  
6 - * @description  
7 - * # newappApp  
8 - *  
9 - * Main module of the application.  
10 - */  
11 -var MakeApp = angular  
12 - .module('newApp', [  
13 - 'ngAnimate',  
14 - 'ngCookies',  
15 - 'ngResource',  
16 - 'ngRoute',  
17 - 'ngSanitize',  
18 - 'ngTouch',  
19 - 'ui.bootstrap'  
20 - ])  
21 - .config(function ($routeProvider) {  
22 - $routeProvider  
23 - .when('/', {  
24 - templateUrl: 'dashboard/dashboard.html',  
25 - controller: 'dashboardCtrl'  
26 - })  
27 - .when('/frontend', {  
28 - templateUrl: 'frontend/frontend.html',  
29 - controller: 'frontendCtrl'  
30 - })  
31 - .when('/charts', {  
32 - templateUrl: 'charts/charts/charts.html',  
33 - controller: 'chartsCtrl'  
34 - })  
35 - .when('/financial-charts', {  
36 - templateUrl: 'charts/financialCharts/financialCharts.html',  
37 - controller: 'financialChartsCtrl'  
38 - })  
39 - .when('/ui-animations', {  
40 - templateUrl: 'uiElements/animations/animations.html',  
41 - controller: 'animationsCtrl'  
42 - })  
43 - .when('/material-buttons', {  
44 - templateUrl: 'uiElements/buttons/material-buttons.html',  
45 - controller: 'buttonsCtrl'  
46 - })  
47 - .when('/material-colors', {  
48 - templateUrl: 'uiElements/colors/material-colors.html',  
49 - controller: 'colorsCtrl'  
50 - })  
51 - .when('/material-cards', {  
52 - templateUrl: 'uiElements/cards/material-cards.html',  
53 - controller: 'cardsCtrl'  
54 - })  
55 - .when('/material-icons', {  
56 - templateUrl: 'uiElements/icons/material-icons.html',  
57 - controller: 'iconsCtrl'  
58 - })  
59 - .when('/ui-components', {  
60 - templateUrl: 'uiElements/components/components.html',  
61 - controller: 'componentsCtrl'  
62 - })  
63 - .when('/ui-helperClasses', {  
64 - templateUrl: 'uiElements/helperClasses/helperClasses.html',  
65 - controller: 'helperClassesCtrl'  
66 - })  
67 - .when('/ui-icons', {  
68 - templateUrl: 'uiElements/icons/icons.html',  
69 - controller: 'iconsCtrl'  
70 - })  
71 - .when('/ui-modals', {  
72 - templateUrl: 'uiElements/modals/modals.html',  
73 - controller: 'modalsCtrl'  
74 - })  
75 - .when('/ui-nestableList', {  
76 - templateUrl: 'uiElements/nestableList/nestableList.html',  
77 - controller: 'nestableListCtrl'  
78 - })  
79 - .when('/ui-notifications', {  
80 - templateUrl: 'uiElements/notifications/notifications.html',  
81 - controller: 'notificationsCtrl'  
82 - })  
83 - .when('/ui-portlets', {  
84 - templateUrl: 'uiElements/portlets/portlets.html',  
85 - controller: 'portletsCtrl'  
86 - })  
87 - .when('/ui-tabs', {  
88 - templateUrl: 'uiElements/Tabs/tabs.html',  
89 - controller: 'tabsCtrl'  
90 - })  
91 - .when('/ui-treeView', {  
92 - templateUrl: 'uiElements/treeView/treeView.html',  
93 - controller: 'treeViewCtrl'  
94 - })  
95 - .when('/ui-typography', {  
96 - templateUrl: 'uiElements/typography/typography.html',  
97 - controller: 'typographyCtrl'  
98 - })  
99 - .when('/email-templates', {  
100 - templateUrl: 'mailbox/mailbox-templates.html',  
101 - controller: 'mailboxTemplatesCtrl'  
102 - })  
103 - .when('/material-forms', {  
104 - templateUrl: 'forms/elements/elements.html',  
105 - controller: 'elementsCtrl'  
106 - })  
107 - .when('/forms-validation', {  
108 - templateUrl: 'forms/validation/validation.html',  
109 - controller: 'elementsCtrl'  
110 - })  
111 - .when('/forms-plugins', {  
112 - templateUrl: 'forms/plugins/plugins.html',  
113 - controller: 'pluginsCtrl'  
114 - })  
115 - .when('/forms-wizard', {  
116 - templateUrl: 'forms/wizard/wizard.html',  
117 - controller: 'wizardCtrl'  
118 - })  
119 - .when('/material-sliders', {  
120 - templateUrl: 'forms/sliders/material-sliders.html',  
121 - controller: 'slidersCtrl'  
122 - })  
123 - .when('/forms-editors', {  
124 - templateUrl: 'forms/editors/editors.html',  
125 - controller: 'editorsCtrl'  
126 - })  
127 - .when('/forms-input-masks', {  
128 - templateUrl: 'forms/inputMasks/inputMasks.html',  
129 - controller: 'inputMasksCtrl'  
130 - })  
131 -  
132 - //medias  
133 - .when('/medias-croping', {  
134 - templateUrl: 'medias/croping/croping.html',  
135 - controller: 'cropingCtrl'  
136 - })  
137 - .when('/medias-hover', {  
138 - templateUrl: 'medias/hover/hover.html',  
139 - controller: 'hoverCtrl'  
140 - })  
141 - .when('/medias-sortable', {  
142 - templateUrl: 'medias/sortable/sortable.html',  
143 - controller: 'sortableCtrl'  
144 - })  
145 - //pages  
146 - .when('/pages-blank', {  
147 - templateUrl: 'pages/blank/blank.html',  
148 - controller: 'blankCtrl'  
149 - })  
150 - .when('/pages-contact', {  
151 - templateUrl: 'pages/contact/contact.html',  
152 - controller: 'contactCtrl'  
153 - })  
154 - .when('/pages-timeline', {  
155 - templateUrl: 'pages/timeline/timeline.html',  
156 - controller: 'timelineCtrl'  
157 - })  
158 - //ecommerce  
159 - .when('/ecom-cart', {  
160 - templateUrl: 'ecommerce/cart/cart.html',  
161 - controller: 'cartCtrl'  
162 - })  
163 - .when('/ecom-invoice', {  
164 - templateUrl: 'ecommerce/invoice/invoice.html',  
165 - controller: 'invoiceCtrl'  
166 - })  
167 - .when('/ecom-pricingTable', {  
168 - templateUrl: 'ecommerce/pricingTable/pricingTable.html',  
169 - controller: 'pricingTableCtrl'  
170 - })  
171 - //extra  
172 - .when('/extra-fullCalendar', {  
173 - templateUrl: 'extra/fullCalendar/fullCalendar.html',  
174 - controller: 'fullCalendarCtrl'  
175 - })  
176 - .when('/extra-google', {  
177 - templateUrl: 'extra/google/google.html',  
178 - controller: 'googleCtrl'  
179 - })  
180 - .when('/extra-slider', {  
181 - templateUrl: 'extra/slider/slider.html',  
182 - controller: 'sliderCtrl'  
183 - })  
184 - .when('/extra-vector', {  
185 - templateUrl: 'extra/vector/vector.html',  
186 - controller: 'vectorCtrl'  
187 - })  
188 - .when('/extra-widgets', {  
189 - templateUrl: 'extra/widgets/widgets.html',  
190 - controller: 'widgetsCtrl'  
191 - })  
192 - //tables  
193 - .when('/tables-dynamic', {  
194 - templateUrl: 'tables/dynamic/dynamic.html',  
195 - controller: 'dynamicCtrl'  
196 - })  
197 - .when('/tables-editable', {  
198 - templateUrl: 'tables/editable/editable.html',  
199 - controller: 'editableCtrl'  
200 - })  
201 - .when('/tables-filter', {  
202 - templateUrl: 'tables/filter/filter.html',  
203 - controller: 'filterCtrl'  
204 - })  
205 - .when('/tables-styling', {  
206 - templateUrl: 'tables/styling/styling.html',  
207 - controller: 'stylingCtrl'  
208 - })  
209 - //user  
210 - .when('/user-profile', {  
211 - templateUrl: 'user/profile/profile.html',  
212 - controller: 'profileCtrl'  
213 - })  
214 - .when('/user-sessionTimeout', {  
215 - templateUrl: 'user/sessionTimeout/sessionTimeout.html',  
216 - controller: 'sessionTimeoutCtrl'  
217 - })  
218 - //layout  
219 - .when('/layout-api', {  
220 - templateUrl: 'layout/api.html',  
221 - controller: 'apiCtrl'  
222 - })  
223 - .otherwise({  
224 - redirectTo: '/'  
225 - });  
226 - });  
227 -  
228 -  
229 -// Route State Load Spinner(used on page or content load)  
230 -MakeApp.directive('ngSpinnerLoader', ['$rootScope',  
231 - function($rootScope) {  
232 - return {  
233 - link: function(scope, element, attrs) {  
234 - // by defult hide the spinner bar  
235 - element.addClass('hide'); // hide spinner bar by default  
236 - // display the spinner bar whenever the route changes(the content part started loading)  
237 - $rootScope.$on('$routeChangeStart', function() {  
238 - element.removeClass('hide'); // show spinner bar  
239 - });  
240 - // hide the spinner bar on rounte change success(after the content loaded)  
241 - $rootScope.$on('$routeChangeSuccess', function() {  
242 - setTimeout(function(){  
243 - element.addClass('hide'); // hide spinner bar  
244 - },500);  
245 - $("html, body").animate({  
246 - scrollTop: 0  
247 - }, 500);  
248 - });  
249 - }  
250 - };  
251 - }  
252 -])  
@@ -1066,7 +1066,7 @@ @@ -1066,7 +1066,7 @@
1066 <script src="plugins/angular-touch/angular-touch.js"></script> 1066 <script src="plugins/angular-touch/angular-touch.js"></script>
1067 <script src="plugins/angular-route/angular-route.js"></script> 1067 <script src="plugins/angular-route/angular-route.js"></script>
1068 <script src="plugins/angular-bootstrap/ui-bootstrap-tpls-0.12.1.js"></script> 1068 <script src="plugins/angular-bootstrap/ui-bootstrap-tpls-0.12.1.js"></script>
1069 - <script src="app.js"></script> 1069 + <script src="scripts/app.js"></script>
1070 <script src="directives/ngViewClass.js"></script> 1070 <script src="directives/ngViewClass.js"></script>
1071 <!-- END ANGULARJS SCRIPTS --> 1071 <!-- END ANGULARJS SCRIPTS -->
1072 1072
@@ -1181,7 +1181,7 @@ @@ -1181,7 +1181,7 @@
1181 <script src="mailbox/mailboxTemplatesCtrl.js"></script> 1181 <script src="mailbox/mailboxTemplatesCtrl.js"></script>
1182 <script src="mailbox/mailboxCtrl.js"></script> 1182 <script src="mailbox/mailboxCtrl.js"></script>
1183 <script src="mailbox/mailSendCtrl.js"></script> 1183 <script src="mailbox/mailSendCtrl.js"></script>
1184 - <script src="mainCtrl.js"></script> 1184 + <script src="scripts/controllers/mainCtrl.js"></script>
1185 <script src="medias/croping/cropingCtrl.js"></script> 1185 <script src="medias/croping/cropingCtrl.js"></script>
1186 <script src="medias/hover/hoverCtrl.js"></script> 1186 <script src="medias/hover/hoverCtrl.js"></script>
1187 <script src="medias/sortable/sortableCtrl.js"></script> 1187 <script src="medias/sortable/sortableCtrl.js"></script>
@@ -2,34 +2,251 @@ @@ -2,34 +2,251 @@
2 2
3 /** 3 /**
4 * @ngdoc overview 4 * @ngdoc overview
5 - * @name adminBuilderBoilerplateApp 5 + * @name newappApp
6 * @description 6 * @description
7 - * # adminBuilderBoilerplateApp 7 + * # newappApp
8 * 8 *
9 * Main module of the application. 9 * Main module of the application.
10 */ 10 */
11 -angular 11 +var MakeApp = angular
12 - .module('adminBuilderBoilerplateApp', [ 12 + .module('newApp', [
13 'ngAnimate', 13 'ngAnimate',
14 'ngCookies', 14 'ngCookies',
15 'ngResource', 15 'ngResource',
16 'ngRoute', 16 'ngRoute',
17 'ngSanitize', 17 'ngSanitize',
18 - 'ngTouch' 18 + 'ngTouch',
  19 + 'ui.bootstrap'
19 ]) 20 ])
20 .config(function ($routeProvider) { 21 .config(function ($routeProvider) {
21 - $routeProvider 22 + $routeProvider
22 - .when('/', { 23 + .when('/', {
23 - templateUrl: 'views/main.html', 24 + templateUrl: 'dashboard/dashboard.html',
24 - controller: 'MainCtrl', 25 + controller: 'dashboardCtrl'
25 - controllerAs: 'main' 26 + })
26 - }) 27 + .when('/frontend', {
27 - .when('/about', { 28 + templateUrl: 'frontend/frontend.html',
28 - templateUrl: 'views/about.html', 29 + controller: 'frontendCtrl'
29 - controller: 'AboutCtrl', 30 + })
30 - controllerAs: 'about' 31 + .when('/charts', {
31 - }) 32 + templateUrl: 'charts/charts/charts.html',
32 - .otherwise({ 33 + controller: 'chartsCtrl'
33 - redirectTo: '/' 34 + })
34 - }); 35 + .when('/financial-charts', {
  36 + templateUrl: 'charts/financialCharts/financialCharts.html',
  37 + controller: 'financialChartsCtrl'
  38 + })
  39 + .when('/ui-animations', {
  40 + templateUrl: 'uiElements/animations/animations.html',
  41 + controller: 'animationsCtrl'
  42 + })
  43 + .when('/material-buttons', {
  44 + templateUrl: 'uiElements/buttons/material-buttons.html',
  45 + controller: 'buttonsCtrl'
  46 + })
  47 + .when('/material-colors', {
  48 + templateUrl: 'uiElements/colors/material-colors.html',
  49 + controller: 'colorsCtrl'
  50 + })
  51 + .when('/material-cards', {
  52 + templateUrl: 'uiElements/cards/material-cards.html',
  53 + controller: 'cardsCtrl'
  54 + })
  55 + .when('/material-icons', {
  56 + templateUrl: 'uiElements/icons/material-icons.html',
  57 + controller: 'iconsCtrl'
  58 + })
  59 + .when('/ui-components', {
  60 + templateUrl: 'uiElements/components/components.html',
  61 + controller: 'componentsCtrl'
  62 + })
  63 + .when('/ui-helperClasses', {
  64 + templateUrl: 'uiElements/helperClasses/helperClasses.html',
  65 + controller: 'helperClassesCtrl'
  66 + })
  67 + .when('/ui-icons', {
  68 + templateUrl: 'uiElements/icons/icons.html',
  69 + controller: 'iconsCtrl'
  70 + })
  71 + .when('/ui-modals', {
  72 + templateUrl: 'uiElements/modals/modals.html',
  73 + controller: 'modalsCtrl'
  74 + })
  75 + .when('/ui-nestableList', {
  76 + templateUrl: 'uiElements/nestableList/nestableList.html',
  77 + controller: 'nestableListCtrl'
  78 + })
  79 + .when('/ui-notifications', {
  80 + templateUrl: 'uiElements/notifications/notifications.html',
  81 + controller: 'notificationsCtrl'
  82 + })
  83 + .when('/ui-portlets', {
  84 + templateUrl: 'uiElements/portlets/portlets.html',
  85 + controller: 'portletsCtrl'
  86 + })
  87 + .when('/ui-tabs', {
  88 + templateUrl: 'uiElements/Tabs/tabs.html',
  89 + controller: 'tabsCtrl'
  90 + })
  91 + .when('/ui-treeView', {
  92 + templateUrl: 'uiElements/treeView/treeView.html',
  93 + controller: 'treeViewCtrl'
  94 + })
  95 + .when('/ui-typography', {
  96 + templateUrl: 'uiElements/typography/typography.html',
  97 + controller: 'typographyCtrl'
  98 + })
  99 + .when('/email-templates', {
  100 + templateUrl: 'mailbox/mailbox-templates.html',
  101 + controller: 'mailboxTemplatesCtrl'
  102 + })
  103 + .when('/material-forms', {
  104 + templateUrl: 'forms/elements/elements.html',
  105 + controller: 'elementsCtrl'
  106 + })
  107 + .when('/forms-validation', {
  108 + templateUrl: 'forms/validation/validation.html',
  109 + controller: 'elementsCtrl'
  110 + })
  111 + .when('/forms-plugins', {
  112 + templateUrl: 'forms/plugins/plugins.html',
  113 + controller: 'pluginsCtrl'
  114 + })
  115 + .when('/forms-wizard', {
  116 + templateUrl: 'forms/wizard/wizard.html',
  117 + controller: 'wizardCtrl'
  118 + })
  119 + .when('/material-sliders', {
  120 + templateUrl: 'forms/sliders/material-sliders.html',
  121 + controller: 'slidersCtrl'
  122 + })
  123 + .when('/forms-editors', {
  124 + templateUrl: 'forms/editors/editors.html',
  125 + controller: 'editorsCtrl'
  126 + })
  127 + .when('/forms-input-masks', {
  128 + templateUrl: 'forms/inputMasks/inputMasks.html',
  129 + controller: 'inputMasksCtrl'
  130 + })
  131 +
  132 + //medias
  133 + .when('/medias-croping', {
  134 + templateUrl: 'medias/croping/croping.html',
  135 + controller: 'cropingCtrl'
  136 + })
  137 + .when('/medias-hover', {
  138 + templateUrl: 'medias/hover/hover.html',
  139 + controller: 'hoverCtrl'
  140 + })
  141 + .when('/medias-sortable', {
  142 + templateUrl: 'medias/sortable/sortable.html',
  143 + controller: 'sortableCtrl'
  144 + })
  145 + //pages
  146 + .when('/pages-blank', {
  147 + templateUrl: 'pages/blank/blank.html',
  148 + controller: 'blankCtrl'
  149 + })
  150 + .when('/pages-contact', {
  151 + templateUrl: 'pages/contact/contact.html',
  152 + controller: 'contactCtrl'
  153 + })
  154 + .when('/pages-timeline', {
  155 + templateUrl: 'pages/timeline/timeline.html',
  156 + controller: 'timelineCtrl'
  157 + })
  158 + //ecommerce
  159 + .when('/ecom-cart', {
  160 + templateUrl: 'ecommerce/cart/cart.html',
  161 + controller: 'cartCtrl'
  162 + })
  163 + .when('/ecom-invoice', {
  164 + templateUrl: 'ecommerce/invoice/invoice.html',
  165 + controller: 'invoiceCtrl'
  166 + })
  167 + .when('/ecom-pricingTable', {
  168 + templateUrl: 'ecommerce/pricingTable/pricingTable.html',
  169 + controller: 'pricingTableCtrl'
  170 + })
  171 + //extra
  172 + .when('/extra-fullCalendar', {
  173 + templateUrl: 'extra/fullCalendar/fullCalendar.html',
  174 + controller: 'fullCalendarCtrl'
  175 + })
  176 + .when('/extra-google', {
  177 + templateUrl: 'extra/google/google.html',
  178 + controller: 'googleCtrl'
  179 + })
  180 + .when('/extra-slider', {
  181 + templateUrl: 'extra/slider/slider.html',
  182 + controller: 'sliderCtrl'
  183 + })
  184 + .when('/extra-vector', {
  185 + templateUrl: 'extra/vector/vector.html',
  186 + controller: 'vectorCtrl'
  187 + })
  188 + .when('/extra-widgets', {
  189 + templateUrl: 'extra/widgets/widgets.html',
  190 + controller: 'widgetsCtrl'
  191 + })
  192 + //tables
  193 + .when('/tables-dynamic', {
  194 + templateUrl: 'tables/dynamic/dynamic.html',
  195 + controller: 'dynamicCtrl'
  196 + })
  197 + .when('/tables-editable', {
  198 + templateUrl: 'tables/editable/editable.html',
  199 + controller: 'editableCtrl'
  200 + })
  201 + .when('/tables-filter', {
  202 + templateUrl: 'tables/filter/filter.html',
  203 + controller: 'filterCtrl'
  204 + })
  205 + .when('/tables-styling', {
  206 + templateUrl: 'tables/styling/styling.html',
  207 + controller: 'stylingCtrl'
  208 + })
  209 + //user
  210 + .when('/user-profile', {
  211 + templateUrl: 'user/profile/profile.html',
  212 + controller: 'profileCtrl'
  213 + })
  214 + .when('/user-sessionTimeout', {
  215 + templateUrl: 'user/sessionTimeout/sessionTimeout.html',
  216 + controller: 'sessionTimeoutCtrl'
  217 + })
  218 + //layout
  219 + .when('/layout-api', {
  220 + templateUrl: 'layout/api.html',
  221 + controller: 'apiCtrl'
  222 + })
  223 + .otherwise({
  224 + redirectTo: '/'
  225 + });
35 }); 226 });
  227 +
  228 +
  229 +// Route State Load Spinner(used on page or content load)
  230 +MakeApp.directive('ngSpinnerLoader', ['$rootScope',
  231 + function($rootScope) {
  232 + return {
  233 + link: function(scope, element, attrs) {
  234 + // by defult hide the spinner bar
  235 + element.addClass('hide'); // hide spinner bar by default
  236 + // display the spinner bar whenever the route changes(the content part started loading)
  237 + $rootScope.$on('$routeChangeStart', function() {
  238 + element.removeClass('hide'); // show spinner bar
  239 + });
  240 + // hide the spinner bar on rounte change success(after the content loaded)
  241 + $rootScope.$on('$routeChangeSuccess', function() {
  242 + setTimeout(function(){
  243 + element.addClass('hide'); // hide spinner bar
  244 + },500);
  245 + $("html, body").animate({
  246 + scrollTop: 0
  247 + }, 500);
  248 + });
  249 + }
  250 + };
  251 + }
  252 +])
  1 +'use strict';
  2 +
  3 +/**
  4 + * @ngdoc overview
  5 + * @name adminBuilderBoilerplateApp
  6 + * @description
  7 + * # adminBuilderBoilerplateApp
  8 + *
  9 + * Main module of the application.
  10 + */
  11 +angular
  12 + .module('adminBuilderBoilerplateApp', [
  13 + 'ngAnimate',
  14 + 'ngCookies',
  15 + 'ngResource',
  16 + 'ngRoute',
  17 + 'ngSanitize',
  18 + 'ngTouch'
  19 + ])
  20 + .config(function ($routeProvider) {
  21 + $routeProvider
  22 + .when('/', {
  23 + templateUrl: 'views/main.html',
  24 + controller: 'MainCtrl',
  25 + controllerAs: 'main'
  26 + })
  27 + .when('/about', {
  28 + templateUrl: 'views/about.html',
  29 + controller: 'AboutCtrl',
  30 + controllerAs: 'about'
  31 + })
  32 + .otherwise({
  33 + redirectTo: '/'
  34 + });
  35 + });