Bruno

Moving app.js & mainCtrl.js

'use strict';
/**
* @ngdoc overview
* @name newappApp
* @description
* # newappApp
*
* Main module of the application.
*/
var MakeApp = angular
.module('newApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch',
'ui.bootstrap'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'dashboard/dashboard.html',
controller: 'dashboardCtrl'
})
.when('/frontend', {
templateUrl: 'frontend/frontend.html',
controller: 'frontendCtrl'
})
.when('/charts', {
templateUrl: 'charts/charts/charts.html',
controller: 'chartsCtrl'
})
.when('/financial-charts', {
templateUrl: 'charts/financialCharts/financialCharts.html',
controller: 'financialChartsCtrl'
})
.when('/ui-animations', {
templateUrl: 'uiElements/animations/animations.html',
controller: 'animationsCtrl'
})
.when('/material-buttons', {
templateUrl: 'uiElements/buttons/material-buttons.html',
controller: 'buttonsCtrl'
})
.when('/material-colors', {
templateUrl: 'uiElements/colors/material-colors.html',
controller: 'colorsCtrl'
})
.when('/material-cards', {
templateUrl: 'uiElements/cards/material-cards.html',
controller: 'cardsCtrl'
})
.when('/material-icons', {
templateUrl: 'uiElements/icons/material-icons.html',
controller: 'iconsCtrl'
})
.when('/ui-components', {
templateUrl: 'uiElements/components/components.html',
controller: 'componentsCtrl'
})
.when('/ui-helperClasses', {
templateUrl: 'uiElements/helperClasses/helperClasses.html',
controller: 'helperClassesCtrl'
})
.when('/ui-icons', {
templateUrl: 'uiElements/icons/icons.html',
controller: 'iconsCtrl'
})
.when('/ui-modals', {
templateUrl: 'uiElements/modals/modals.html',
controller: 'modalsCtrl'
})
.when('/ui-nestableList', {
templateUrl: 'uiElements/nestableList/nestableList.html',
controller: 'nestableListCtrl'
})
.when('/ui-notifications', {
templateUrl: 'uiElements/notifications/notifications.html',
controller: 'notificationsCtrl'
})
.when('/ui-portlets', {
templateUrl: 'uiElements/portlets/portlets.html',
controller: 'portletsCtrl'
})
.when('/ui-tabs', {
templateUrl: 'uiElements/Tabs/tabs.html',
controller: 'tabsCtrl'
})
.when('/ui-treeView', {
templateUrl: 'uiElements/treeView/treeView.html',
controller: 'treeViewCtrl'
})
.when('/ui-typography', {
templateUrl: 'uiElements/typography/typography.html',
controller: 'typographyCtrl'
})
.when('/email-templates', {
templateUrl: 'mailbox/mailbox-templates.html',
controller: 'mailboxTemplatesCtrl'
})
.when('/material-forms', {
templateUrl: 'forms/elements/elements.html',
controller: 'elementsCtrl'
})
.when('/forms-validation', {
templateUrl: 'forms/validation/validation.html',
controller: 'elementsCtrl'
})
.when('/forms-plugins', {
templateUrl: 'forms/plugins/plugins.html',
controller: 'pluginsCtrl'
})
.when('/forms-wizard', {
templateUrl: 'forms/wizard/wizard.html',
controller: 'wizardCtrl'
})
.when('/material-sliders', {
templateUrl: 'forms/sliders/material-sliders.html',
controller: 'slidersCtrl'
})
.when('/forms-editors', {
templateUrl: 'forms/editors/editors.html',
controller: 'editorsCtrl'
})
.when('/forms-input-masks', {
templateUrl: 'forms/inputMasks/inputMasks.html',
controller: 'inputMasksCtrl'
})
//medias
.when('/medias-croping', {
templateUrl: 'medias/croping/croping.html',
controller: 'cropingCtrl'
})
.when('/medias-hover', {
templateUrl: 'medias/hover/hover.html',
controller: 'hoverCtrl'
})
.when('/medias-sortable', {
templateUrl: 'medias/sortable/sortable.html',
controller: 'sortableCtrl'
})
//pages
.when('/pages-blank', {
templateUrl: 'pages/blank/blank.html',
controller: 'blankCtrl'
})
.when('/pages-contact', {
templateUrl: 'pages/contact/contact.html',
controller: 'contactCtrl'
})
.when('/pages-timeline', {
templateUrl: 'pages/timeline/timeline.html',
controller: 'timelineCtrl'
})
//ecommerce
.when('/ecom-cart', {
templateUrl: 'ecommerce/cart/cart.html',
controller: 'cartCtrl'
})
.when('/ecom-invoice', {
templateUrl: 'ecommerce/invoice/invoice.html',
controller: 'invoiceCtrl'
})
.when('/ecom-pricingTable', {
templateUrl: 'ecommerce/pricingTable/pricingTable.html',
controller: 'pricingTableCtrl'
})
//extra
.when('/extra-fullCalendar', {
templateUrl: 'extra/fullCalendar/fullCalendar.html',
controller: 'fullCalendarCtrl'
})
.when('/extra-google', {
templateUrl: 'extra/google/google.html',
controller: 'googleCtrl'
})
.when('/extra-slider', {
templateUrl: 'extra/slider/slider.html',
controller: 'sliderCtrl'
})
.when('/extra-vector', {
templateUrl: 'extra/vector/vector.html',
controller: 'vectorCtrl'
})
.when('/extra-widgets', {
templateUrl: 'extra/widgets/widgets.html',
controller: 'widgetsCtrl'
})
//tables
.when('/tables-dynamic', {
templateUrl: 'tables/dynamic/dynamic.html',
controller: 'dynamicCtrl'
})
.when('/tables-editable', {
templateUrl: 'tables/editable/editable.html',
controller: 'editableCtrl'
})
.when('/tables-filter', {
templateUrl: 'tables/filter/filter.html',
controller: 'filterCtrl'
})
.when('/tables-styling', {
templateUrl: 'tables/styling/styling.html',
controller: 'stylingCtrl'
})
//user
.when('/user-profile', {
templateUrl: 'user/profile/profile.html',
controller: 'profileCtrl'
})
.when('/user-sessionTimeout', {
templateUrl: 'user/sessionTimeout/sessionTimeout.html',
controller: 'sessionTimeoutCtrl'
})
//layout
.when('/layout-api', {
templateUrl: 'layout/api.html',
controller: 'apiCtrl'
})
.otherwise({
redirectTo: '/'
});
});
// Route State Load Spinner(used on page or content load)
MakeApp.directive('ngSpinnerLoader', ['$rootScope',
function($rootScope) {
return {
link: function(scope, element, attrs) {
// by defult hide the spinner bar
element.addClass('hide'); // hide spinner bar by default
// display the spinner bar whenever the route changes(the content part started loading)
$rootScope.$on('$routeChangeStart', function() {
element.removeClass('hide'); // show spinner bar
});
// hide the spinner bar on rounte change success(after the content loaded)
$rootScope.$on('$routeChangeSuccess', function() {
setTimeout(function(){
element.addClass('hide'); // hide spinner bar
},500);
$("html, body").animate({
scrollTop: 0
}, 500);
});
}
};
}
])
\ No newline at end of file
... ... @@ -1066,7 +1066,7 @@
<script src="plugins/angular-touch/angular-touch.js"></script>
<script src="plugins/angular-route/angular-route.js"></script>
<script src="plugins/angular-bootstrap/ui-bootstrap-tpls-0.12.1.js"></script>
<script src="app.js"></script>
<script src="scripts/app.js"></script>
<script src="directives/ngViewClass.js"></script>
<!-- END ANGULARJS SCRIPTS -->
... ... @@ -1181,7 +1181,7 @@
<script src="mailbox/mailboxTemplatesCtrl.js"></script>
<script src="mailbox/mailboxCtrl.js"></script>
<script src="mailbox/mailSendCtrl.js"></script>
<script src="mainCtrl.js"></script>
<script src="scripts/controllers/mainCtrl.js"></script>
<script src="medias/croping/cropingCtrl.js"></script>
<script src="medias/hover/hoverCtrl.js"></script>
<script src="medias/sortable/sortableCtrl.js"></script>
... ...
... ... @@ -2,34 +2,251 @@
/**
* @ngdoc overview
* @name adminBuilderBoilerplateApp
* @name newappApp
* @description
* # adminBuilderBoilerplateApp
* # newappApp
*
* Main module of the application.
*/
angular
.module('adminBuilderBoilerplateApp', [
var MakeApp = angular
.module('newApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch'
'ngTouch',
'ui.bootstrap'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
controllerAs: 'main'
templateUrl: 'dashboard/dashboard.html',
controller: 'dashboardCtrl'
})
.when('/about', {
templateUrl: 'views/about.html',
controller: 'AboutCtrl',
controllerAs: 'about'
.when('/frontend', {
templateUrl: 'frontend/frontend.html',
controller: 'frontendCtrl'
})
.when('/charts', {
templateUrl: 'charts/charts/charts.html',
controller: 'chartsCtrl'
})
.when('/financial-charts', {
templateUrl: 'charts/financialCharts/financialCharts.html',
controller: 'financialChartsCtrl'
})
.when('/ui-animations', {
templateUrl: 'uiElements/animations/animations.html',
controller: 'animationsCtrl'
})
.when('/material-buttons', {
templateUrl: 'uiElements/buttons/material-buttons.html',
controller: 'buttonsCtrl'
})
.when('/material-colors', {
templateUrl: 'uiElements/colors/material-colors.html',
controller: 'colorsCtrl'
})
.when('/material-cards', {
templateUrl: 'uiElements/cards/material-cards.html',
controller: 'cardsCtrl'
})
.when('/material-icons', {
templateUrl: 'uiElements/icons/material-icons.html',
controller: 'iconsCtrl'
})
.when('/ui-components', {
templateUrl: 'uiElements/components/components.html',
controller: 'componentsCtrl'
})
.when('/ui-helperClasses', {
templateUrl: 'uiElements/helperClasses/helperClasses.html',
controller: 'helperClassesCtrl'
})
.when('/ui-icons', {
templateUrl: 'uiElements/icons/icons.html',
controller: 'iconsCtrl'
})
.when('/ui-modals', {
templateUrl: 'uiElements/modals/modals.html',
controller: 'modalsCtrl'
})
.when('/ui-nestableList', {
templateUrl: 'uiElements/nestableList/nestableList.html',
controller: 'nestableListCtrl'
})
.when('/ui-notifications', {
templateUrl: 'uiElements/notifications/notifications.html',
controller: 'notificationsCtrl'
})
.when('/ui-portlets', {
templateUrl: 'uiElements/portlets/portlets.html',
controller: 'portletsCtrl'
})
.when('/ui-tabs', {
templateUrl: 'uiElements/Tabs/tabs.html',
controller: 'tabsCtrl'
})
.when('/ui-treeView', {
templateUrl: 'uiElements/treeView/treeView.html',
controller: 'treeViewCtrl'
})
.when('/ui-typography', {
templateUrl: 'uiElements/typography/typography.html',
controller: 'typographyCtrl'
})
.when('/email-templates', {
templateUrl: 'mailbox/mailbox-templates.html',
controller: 'mailboxTemplatesCtrl'
})
.when('/material-forms', {
templateUrl: 'forms/elements/elements.html',
controller: 'elementsCtrl'
})
.when('/forms-validation', {
templateUrl: 'forms/validation/validation.html',
controller: 'elementsCtrl'
})
.when('/forms-plugins', {
templateUrl: 'forms/plugins/plugins.html',
controller: 'pluginsCtrl'
})
.when('/forms-wizard', {
templateUrl: 'forms/wizard/wizard.html',
controller: 'wizardCtrl'
})
.when('/material-sliders', {
templateUrl: 'forms/sliders/material-sliders.html',
controller: 'slidersCtrl'
})
.when('/forms-editors', {
templateUrl: 'forms/editors/editors.html',
controller: 'editorsCtrl'
})
.when('/forms-input-masks', {
templateUrl: 'forms/inputMasks/inputMasks.html',
controller: 'inputMasksCtrl'
})
//medias
.when('/medias-croping', {
templateUrl: 'medias/croping/croping.html',
controller: 'cropingCtrl'
})
.when('/medias-hover', {
templateUrl: 'medias/hover/hover.html',
controller: 'hoverCtrl'
})
.when('/medias-sortable', {
templateUrl: 'medias/sortable/sortable.html',
controller: 'sortableCtrl'
})
//pages
.when('/pages-blank', {
templateUrl: 'pages/blank/blank.html',
controller: 'blankCtrl'
})
.when('/pages-contact', {
templateUrl: 'pages/contact/contact.html',
controller: 'contactCtrl'
})
.when('/pages-timeline', {
templateUrl: 'pages/timeline/timeline.html',
controller: 'timelineCtrl'
})
//ecommerce
.when('/ecom-cart', {
templateUrl: 'ecommerce/cart/cart.html',
controller: 'cartCtrl'
})
.when('/ecom-invoice', {
templateUrl: 'ecommerce/invoice/invoice.html',
controller: 'invoiceCtrl'
})
.when('/ecom-pricingTable', {
templateUrl: 'ecommerce/pricingTable/pricingTable.html',
controller: 'pricingTableCtrl'
})
//extra
.when('/extra-fullCalendar', {
templateUrl: 'extra/fullCalendar/fullCalendar.html',
controller: 'fullCalendarCtrl'
})
.when('/extra-google', {
templateUrl: 'extra/google/google.html',
controller: 'googleCtrl'
})
.when('/extra-slider', {
templateUrl: 'extra/slider/slider.html',
controller: 'sliderCtrl'
})
.when('/extra-vector', {
templateUrl: 'extra/vector/vector.html',
controller: 'vectorCtrl'
})
.when('/extra-widgets', {
templateUrl: 'extra/widgets/widgets.html',
controller: 'widgetsCtrl'
})
//tables
.when('/tables-dynamic', {
templateUrl: 'tables/dynamic/dynamic.html',
controller: 'dynamicCtrl'
})
.when('/tables-editable', {
templateUrl: 'tables/editable/editable.html',
controller: 'editableCtrl'
})
.when('/tables-filter', {
templateUrl: 'tables/filter/filter.html',
controller: 'filterCtrl'
})
.when('/tables-styling', {
templateUrl: 'tables/styling/styling.html',
controller: 'stylingCtrl'
})
//user
.when('/user-profile', {
templateUrl: 'user/profile/profile.html',
controller: 'profileCtrl'
})
.when('/user-sessionTimeout', {
templateUrl: 'user/sessionTimeout/sessionTimeout.html',
controller: 'sessionTimeoutCtrl'
})
//layout
.when('/layout-api', {
templateUrl: 'layout/api.html',
controller: 'apiCtrl'
})
.otherwise({
redirectTo: '/'
});
});
// Route State Load Spinner(used on page or content load)
MakeApp.directive('ngSpinnerLoader', ['$rootScope',
function($rootScope) {
return {
link: function(scope, element, attrs) {
// by defult hide the spinner bar
element.addClass('hide'); // hide spinner bar by default
// display the spinner bar whenever the route changes(the content part started loading)
$rootScope.$on('$routeChangeStart', function() {
element.removeClass('hide'); // show spinner bar
});
// hide the spinner bar on rounte change success(after the content loaded)
$rootScope.$on('$routeChangeSuccess', function() {
setTimeout(function(){
element.addClass('hide'); // hide spinner bar
},500);
$("html, body").animate({
scrollTop: 0
}, 500);
});
}
};
}
])
\ No newline at end of file
... ...
'use strict';
/**
* @ngdoc overview
* @name adminBuilderBoilerplateApp
* @description
* # adminBuilderBoilerplateApp
*
* Main module of the application.
*/
angular
.module('adminBuilderBoilerplateApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
controllerAs: 'main'
})
.when('/about', {
templateUrl: 'views/about.html',
controller: 'AboutCtrl',
controllerAs: 'about'
})
.otherwise({
redirectTo: '/'
});
});
... ...