@incdevco/framework
Version:
node.js lambda framework
77 lines (54 loc) • 1.48 kB
JavaScript
/* global angular */
angular.module('main', [
'ngAnimate',
'ngAria',
'ngMaterial',
'ngMessages',
'ngRoute',
'ngSanitize',
'auth',
'aws'
])
.config([
'$locationProvider',
'$routeProvider',
function ($locationProvider, $routeProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {
controller: 'HomepageController',
controllerAs: 'crtl',
templateUrl: 'templates/homepage.html'
})
.otherwise({
templateUrl: 'templates/error.html'
});
}
])
.constant('COGNITO_IDENTITY_POOL_ID', 'COGNITO_IDENTITY_POOL_ID_REPLACE')
.constant('COGNITO_IDENTITY_POOL_REGION', 'COGNITO_IDENTITY_POOL_REGION_REPLACE')
.constant('COGNITO_IDENTITY_SESSION_NAME', 'www-client')
.constant('VERSION', 'VERSION_REPLACE')
.controller('HomepageController', [
function () {
}
])
.run([
'$mdSidenav',
'$rootScope',
function ($mdSidenav, $rootScope) {
$rootScope.routeLoading = false;
$rootScope.toggleLeftSidenav = function () {
$mdSidenav('left', true).toggle();
};
$rootScope.$on('$routeChangeError', function () {
$rootScope.routeLoading = false;
});
$rootScope.$on('$routeChangeStart', function () {
$rootScope.routeLoading = true;
});
$rootScope.$on('$routeChangeSuccess', function () {
$rootScope.routeLoading = false;
});
}
]);