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

codex-app.js 1.4KB

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