var service = { promise : null }
+ // Load date/time format settings on all pages. Add more .push(...)
+ // calls to add more universal data-loading functions.
+ // egEnv.loaders functions must return a promise.
+ egEnv.loaders.push(
+ function() {
+ return egOrg.settings([
+ 'webstaff.format.dates',
+ 'webstaff.format.date_and_time'
+ ]).then(
+ function(set) {
+ $rootScope.egDateFormat =
+ set['webstaff.format.dates'] || 'shortDate';
+ $rootScope.egDateAndTimeFormat =
+ set['webstaff.format.date_and_time'] || 'short';
+ }
+ );
+ },
+ );
+
// returns true if we are staying on the current page
// false if we are redirecting to login
service.expiredAuthHandler = function() {
deferred.reject('egEnv did not resolve')
}
);
- egOrg.settings([
- 'webstaff.format.dates',
- 'webstaff.format.date_and_time'
- ]).then(
- function(set) {
- $rootScope.egDateFormat = set['webstaff.format.dates'] || 'shortDate';
- $rootScope.egDateAndTimeFormat = set['webstaff.format.date_and_time'] || 'short';
- deferred.resolve();
- },
- function() {
- deferred.reject('egOrg did not resolve');
- }
- );
},
// testAuthToken rejected