router.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. angular.module('appMessage').run(['$rootScope', '$state', '$stateParams',
  2. function($rootScope, $state, $stateParams) {
  3. $rootScope.$state = $state;
  4. $rootScope.$stateParams = $stateParams;
  5. }
  6. ]).config(['$stateProvider', '$urlRouterProvider', '$compileProvider',
  7. function($stateProvider, $urlRouterProvider, $compileProvider) {
  8. $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|local):/);
  9. $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|local):/);
  10. $urlRouterProvider.otherwise('/historyMsg'); //
  11. $stateProvider.state('messages', {
  12. url: '/messages',
  13. templateUrl: 'templates/messages.html',
  14. controller: 'MessageController'
  15. })
  16. .state('transmitter', {
  17. url: '/transmitter',
  18. templateUrl: 'templates/transmitter.html',
  19. controller: 'TransmitterController'
  20. })
  21. .state('details', {
  22. url: '/details',
  23. templateUrl: 'templates/details-right.html',
  24. controller: 'UserController'
  25. })
  26. .state('smsSend', {
  27. url: '/smsSend',
  28. templateUrl: 'templates/smsSend.html',
  29. controller: 'SmsController'
  30. })
  31. .state('historyMsg', {
  32. url: '/historyMsg',
  33. templateUrl: 'templates/historyMsg.html',
  34. controller: 'HistoryMsgController'
  35. });
  36. }
  37. ]);