You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.js 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. 'use strict';
  2. /* App Module */
  3. angular.module('app', [
  4. 'ui.bootstrap',
  5. 'ui.router',
  6. 'LocalStorageModule',
  7. 'ngMaterial',
  8. 'md.data.table',
  9. 'sasrio.angular-material-sidenav',
  10. 'luticate2Utils',
  11. // 'luticateAuth',
  12. 'appSdk'
  13. ])
  14. .config(['$stateProvider', '$urlRouterProvider', 'ssSideNavSectionsProvider', '$mdThemingProvider', '$mdIconProvider',
  15. function($stateProvider, $urlRouterProvider, ssSideNavSectionsProvider, $mdThemingProvider, $mdIconProvider) {
  16. // $mdThemingProvider
  17. // .theme('default')
  18. // .primaryPalette('blue', {
  19. // 'default': '700'
  20. // });
  21. // $mdThemingProvider.theme('default')
  22. // .primaryPalette('blue')
  23. // .accentPalette('pink');
  24. $mdIconProvider
  25. .icon('md-toggle-arrow', 'img/arrow.svg');
  26. ssSideNavSectionsProvider.initWithTheme($mdThemingProvider);
  27. ssSideNavSectionsProvider.initWithSections([{
  28. id: 'toogle_1',
  29. name: 'Home',
  30. type: 'heading',
  31. children: [{
  32. name: 'Home 1',
  33. type: 'toggle',
  34. pages: [{
  35. id: 'toogle_1_link_1',
  36. name: 'Home 1 1',
  37. state: 'home'
  38. }, {
  39. id: 'toogle_1_link_2',
  40. name: 'Home 1 2',
  41. state: 'home.1.2',
  42. hidden: true
  43. }, {
  44. id: 'toogle_1_link_3',
  45. name: 'Home 1 3',
  46. state: 'home.1.3'
  47. }]
  48. }]
  49. }, {
  50. id: 'link_1',
  51. name: 'Home 2 ',
  52. state: 'home.2',
  53. type: 'link',
  54. icon: 'fa fa-check'
  55. }, {
  56. id: 'link_2',
  57. name: 'Home 3',
  58. state: 'home.3',
  59. type: 'link'
  60. }, {
  61. id: 'link_3',
  62. name: 'Link 3',
  63. state: 'common.link3',
  64. type: 'link',
  65. hidden: true
  66. }, {
  67. id: 'toogle_2',
  68. name: 'PkGuid',
  69. type: 'heading',
  70. children: [{
  71. name: 'PkGuids',
  72. type: 'toggle',
  73. pages: [{
  74. id: 'toogle_2_link_1',
  75. name: 'All',
  76. state: 'pkguid'
  77. },{
  78. id: 'toogle_2_link_1',
  79. name: 'New',
  80. state: 'pkguid_add'
  81. }]
  82. }]
  83. }]);
  84. $stateProvider.state('root', {
  85. abstract: true,
  86. template: '<div ui-view=""></div>',
  87. // resolve: ['luticateAuthUsers', function(luticateAuthUsers)
  88. // {
  89. // return luticateAuthUsers.loadUserData(null);
  90. // }]
  91. });
  92. $stateProvider.state('home', {
  93. url:'/',
  94. parent: 'root',
  95. title: "Home",
  96. reloadOnSearch: false,
  97. templateUrl:'views/home.html',
  98. controller:'HomeController'
  99. });
  100. $stateProvider.state('pkguid', {
  101. url:'/pkguids',
  102. parent: 'root',
  103. title: "PkGuid",
  104. reloadOnSearch: false,
  105. templateUrl:'views/pkguid.html',
  106. controller:'PkGuidController'
  107. });
  108. $stateProvider.state('pkguid_add', {
  109. url:'/pkguids/add',
  110. parent: 'root',
  111. title: "New PkGuid",
  112. reloadOnSearch: false,
  113. templateUrl:'views/pkguidedit.html',
  114. controller:'PkGuidEditController'
  115. });
  116. $stateProvider.state('pkguid_edit', {
  117. url:'/pkguids/edit/:id',
  118. parent: 'root',
  119. title: "Edit PkGuid",
  120. reloadOnSearch: false,
  121. templateUrl:'views/pkguidedit.html',
  122. controller:'PkGuidEditController',
  123. params: {
  124. pkguid: null
  125. }
  126. });
  127. $urlRouterProvider.otherwise('/');
  128. }])
  129. .directive('dateNow', ['$filter', function($filter) {
  130. return {
  131. link: function( $scope, $element, $attrs) {
  132. $element.text($filter('date')(new Date(), $attrs.dateNow));
  133. }
  134. };
  135. }])
  136. .run(['$rootScope', '$transitions', function ($rootScope, $transitions) {
  137. $transitions.onSuccess({}, function($transitions)
  138. {
  139. var toState = $transitions.$to();
  140. $rootScope.title = toState.title + " - App";
  141. });
  142. }]);