tellform/public/application.js

32 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-06-29 22:51:29 +00:00
'use strict';
//Start by defining the main module and adding the module dependencies
angular.module(ApplicationConfiguration.applicationModuleName, ApplicationConfiguration.applicationModuleVendorDependencies);
// Setting HTML5 Location Mode
angular.module(ApplicationConfiguration.applicationModuleName).config(['$locationProvider',
function($locationProvider) {
$locationProvider.hashPrefix('!');
}
]);
2015-06-30 20:57:20 +00:00
angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope',
function($rootScope) {
2015-06-29 22:51:29 +00:00
$rootScope.$on('$stateChangeStart', function(event, toState, toStateParams) {
// track the state the user wants to go to; authorization service needs this
$rootScope.toState = toState;
$rootScope.toStateParams = toStateParams;
// if the principal is resolved, do an authorization check immediately. otherwise,
// it'll be done when the state it resolved.
2015-06-30 07:28:29 +00:00
// if (Principal.isIdentityResolved()) Authorization.authorize();
2015-06-29 22:51:29 +00:00
});
}
]);
//Then define the init function for starting up the application
angular.element(document).ready(function() {
//Fixing facebook bug with redirect
if (window.location.hash === '#_=_') window.location.hash = '#!';
//Then init the app
angular.bootstrap(document, [ApplicationConfiguration.applicationModuleName]);
});