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.

73 lines
1.9 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.browse', {
  38. url: '/browse',
  39. views: {
  40. 'menuContent': {
  41. templateUrl: 'templates/browse.html'
  42. }
  43. }
  44. })
  45. .state('app.travels', {
  46. url: '/travels',
  47. views: {
  48. 'menuContent': {
  49. templateUrl: 'templates/travels.html',
  50. controller: 'TravelsCtrl'
  51. }
  52. }
  53. })
  54. .state('app.travel', {
  55. url: '/travels/:travelId',
  56. views: {
  57. 'menuContent': {
  58. templateUrl: 'templates/travel.html',
  59. controller: 'TravelCtrl'
  60. }
  61. }
  62. });
  63. // if none of the above states are matched, use this as the fallback
  64. $urlRouterProvider.otherwise('/app/travels');
  65. });