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

codex-app.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * @ngdoc overview
  3. * @name domainManagerApp
  4. * @description
  5. * # domainManagerApp
  6. *
  7. * Main module of the application.
  8. */
  9. angular
  10. .module('codexApp', [
  11. 'ui.router',
  12. 'ngSanitize',
  13. 'ui.ace',
  14. 'codexApp.index',
  15. 'codexApp.header',
  16. 'codexApp.sidebar',
  17. 'codexApp.noteView',
  18. 'codexApp.noteEdit'
  19. ])
  20. .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', function($stateProvider, $urlRouterProvider, $httpProvider) {
  21. // Configs
  22. //Enable cross domain calls
  23. $httpProvider.defaults.useXDomain = true;
  24. //Remove the header used to identify ajax call that would prevent CORS from working
  25. delete $httpProvider.defaults.headers.common['X-Requested-With'];
  26. // UI router
  27. // For any unmatched url, redirect to /state1
  28. $stateProvider
  29. .state('index', {
  30. url: "/",
  31. templateUrl: 'views/index.html',
  32. controller: 'AppCtrl'
  33. })
  34. .state('note-view', {
  35. url: "/note-view",
  36. templateUrl: "views/note-view.html",
  37. controller: 'NoteViewCtrl',
  38. resolve: {
  39. pageData: function($stateParams) {
  40. //console.log('resolve ok')
  41. return 'resolve ok';
  42. },
  43. }
  44. })
  45. .state('note-edit', {
  46. url: "/note-edit",
  47. templateUrl: "views/note-edit.html",
  48. controller: 'NoteEditCtrl'
  49. })
  50. $urlRouterProvider.otherwise("/");
  51. }]);