Update configuration.

This commit is contained in:
Alexis Lahouze 2016-02-07 23:07:40 +01:00
parent 1dbc037122
commit f97a4a7655

View File

@ -41,41 +41,55 @@ var accountantApp = angular.module("accountantApp", [
return sessionInjector; return sessionInjector;
}]) }])
.config(['$httpProvider', function($httpProvider) {
.config(["$httpProvider", "$routeProvider", "$locationProvider", "$storageProvider", "$resourceProvider",
function($httpProvider, $routeProvider, $locationProvider, $storageProvider, $resourceProvider) {
// Define interceptors. // Define interceptors.
$httpProvider.interceptors.push('sessionInjector'); $httpProvider.interceptors.push('sessionInjector');
}])
.config(['$routeProvider', function($routeProvider) {
// Defining template and controller in function of route. // Defining template and controller in function of route.
$routeProvider.when('/account/:accountId/operations', { $routeProvider
.when('/account/:accountId/operations', {
templateUrl: 'static/templates/operations.html', templateUrl: 'static/templates/operations.html',
controller: 'OperationController' controller: 'OperationController',
}).when('/account/:accountId/scheduler', { controllerAs: 'operations'
})
.when('/account/:accountId/scheduler', {
templateUrl: 'static/templates/scheduler.html', templateUrl: 'static/templates/scheduler.html',
controller: 'SchedulerController' controller: 'SchedulerController',
}).when('/accounts', { controllerAs: 'scheduler'
})
.when('/accounts', {
templateUrl: 'static/templates/accounts.html', templateUrl: 'static/templates/accounts.html',
controller: 'AccountController' controller: 'AccountController',
}).when('/', { controllerAs: 'accounts'
redirectTo: 'accounts' })
}); .otherwise({
redirectTo: '/accounts'
});
}])
.config(['$locationProvider', function($locationProvider) {
// Enable HTML5 mode. // Enable HTML5 mode.
$locationProvider.html5Mode(true); $locationProvider.html5Mode(true);
}])
.config(['$storageProvider', function($storageProvider) {
// Configure storage // Configure storage
// Set global prefix for stored keys // Set global prefix for stored keys
$storageProvider.setPrefix("accountant"); $storageProvider.setPrefix('accountant');
// Change the default storage engine // Change the default storage engine
// Defaults to "local" // Defaults to 'local'
$storageProvider.setDefaultStorageEngine("session"); $storageProvider.setDefaultStorageEngine('session');
// Change the enabled storage engines // Change the enabled storage engines
// Defaults to ['memory', 'cookie', 'session', 'local'] // Defaults to ['memory', 'cookie', 'session', 'local']
$storageProvider.setEnabledStorageEngines(['local', 'session']); $storageProvider.setEnabledStorageEngines(['local', 'session']);
}])
.config(['$resourceProvider', function($resourceProvider) {
// Keep trailing slashes to avoid redirect by flask.. // Keep trailing slashes to avoid redirect by flask..
$resourceProvider.defaults.stripTrailingSlashes = false; $resourceProvider.defaults.stripTrailingSlashes = false;
}]) }])