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.

83 lines
2.1 KiB

  1. // Ionic Starter App
  2. // angular.module is a global place for creating, registering and retrieving Angular modules
  3. // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
  4. // the 2nd parameter is an array of 'requires'
  5. // 'starter.controllers' is found in controllers.js
  6. angular.module('starter', ['ionic', 'starter.controllers'])
  7. .run(function($ionicPlatform) {
  8. $ionicPlatform.ready(function() {
  9. // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
  10. // for form inputs)
  11. if (window.cordova && window.cordova.plugins.Keyboard) {
  12. cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  13. cordova.plugins.Keyboard.disableScroll(true);
  14. }
  15. if (window.StatusBar) {
  16. // org.apache.cordova.statusbar required
  17. StatusBar.styleDefault();
  18. }
  19. });
  20. })
  21. .config(function($stateProvider, $urlRouterProvider) {
  22. $stateProvider
  23. .state('app', {
  24. url: '/app',
  25. abstract: true,
  26. templateUrl: 'templates/menu.html',
  27. controller: 'AppCtrl'
  28. })
  29. .state('app.search', {
  30. url: '/search',
  31. views: {
  32. 'menuContent': {
  33. templateUrl: 'templates/search.html'
  34. }
  35. }
  36. })
  37. .state('app.users', {
  38. url: '/users',
  39. views: {
  40. 'menuContent': {
  41. templateUrl: 'templates/users.html',
  42. controller: 'UsersCtrl'
  43. }
  44. }
  45. })
  46. .state('app.user', {
  47. url: '/users/:username',
  48. views: {
  49. 'menuContent': {
  50. templateUrl: 'templates/user.html',
  51. controller: 'UserCtrl'
  52. }
  53. }
  54. })
  55. .state('app.travels', {
  56. url: '/travels',
  57. views: {
  58. 'menuContent': {
  59. templateUrl: 'templates/travels.html',
  60. controller: 'TravelsCtrl'
  61. }
  62. }
  63. })
  64. .state('app.travel', {
  65. url: '/travels/:travelId',
  66. views: {
  67. 'menuContent': {
  68. templateUrl: 'templates/travel.html',
  69. controller: 'TravelCtrl'
  70. }
  71. }
  72. });
  73. // if none of the above states are matched, use this as the fallback
  74. $urlRouterProvider.otherwise('/app/travels');
  75. });