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

codex-app.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.footer',
  17. 'codexApp.sidebar',
  18. 'codexApp.noteView',
  19. 'codexApp.noteEdit',
  20. 'codexApp.imageView',
  21. 'hljs'
  22. ])
  23. .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', function($stateProvider, $urlRouterProvider, $httpProvider) {
  24. // Configs
  25. //Enable cross domain calls
  26. $httpProvider.defaults.useXDomain = true;
  27. //Remove the header used to identify ajax call that would prevent CORS from working
  28. delete $httpProvider.defaults.headers.common['X-Requested-With'];
  29. // UI router
  30. // For any unmatched url, redirect to /state1
  31. $stateProvider
  32. .state('index', {
  33. url: "/",
  34. templateUrl: 'views/index.html',
  35. controller: 'AppCtrl'
  36. })
  37. .state('note-view', {
  38. url: "/note-view",
  39. templateUrl: "views/note-view.html",
  40. controller: 'NoteViewCtrl',
  41. resolve: {
  42. pageData: function($stateParams) {
  43. //console.log('resolve ok')
  44. return 'resolve ok';
  45. },
  46. }
  47. })
  48. .state('note-edit', {
  49. url: "/note-edit",
  50. templateUrl: "views/note-edit.html",
  51. controller: 'NoteEditCtrl'
  52. })
  53. .state('image-view', {
  54. url: "/image-view",
  55. templateUrl: "views/image-view.html",
  56. controller: 'ImageViewCtrl'
  57. })
  58. $urlRouterProvider.otherwise("/");
  59. }]);