Desktop markdown wiki app. Built with node, Electron Framework and AngularJS.

preferences.js 969B

12345678910111213141516171819202122232425262728293031323334353637
  1. angular
  2. .module('codexApp', [
  3. 'ui.router',
  4. 'ngSanitize',
  5. 'codexApp.prefs.nav',
  6. 'codexApp.prefs.general',
  7. 'codexApp.prefs.databases'
  8. ])
  9. .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', function($stateProvider, $urlRouterProvider, $httpProvider) {
  10. // Configs
  11. //Enable cross domain calls
  12. $httpProvider.defaults.useXDomain = true;
  13. //Remove the header used to identify ajax call that would prevent CORS from working
  14. delete $httpProvider.defaults.headers.common['X-Requested-With'];
  15. // UI router
  16. // For any unmatched url, redirect to /state1
  17. $stateProvider
  18. .state('general', {
  19. url: "/",
  20. templateUrl: 'views/preferences/general.html',
  21. controller: 'GeneralPrefsCtrl'
  22. })
  23. .state('databases', {
  24. url: "/databases",
  25. templateUrl: 'views/preferences/databases.html',
  26. controller: 'DatabasesPrefsCtrl'
  27. })
  28. $urlRouterProvider.otherwise("/");
  29. }]);