app.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. }
  14. if (window.StatusBar) {
  15. // org.apache.cordova.statusbar required
  16. StatusBar.styleDefault();
  17. }
  18. });
  19. })
  20. .config(function($stateProvider, $urlRouterProvider) {
  21. $stateProvider
  22. .state('app', {
  23. url: "/app",
  24. abstract: true,
  25. templateUrl: "templates/menu.html",
  26. controller: 'AppCtrl'
  27. })
  28. .state('app.search', {
  29. url: "/search",
  30. views: {
  31. 'menuContent': {
  32. templateUrl: "templates/search.html"
  33. }
  34. }
  35. })
  36. .state('app.browse', {
  37. url: "/browse",
  38. views: {
  39. 'menuContent': {
  40. templateUrl: "templates/browse.html"
  41. }
  42. }
  43. })
  44. .state('app.sessions', {
  45. url: "/sessions",
  46. views: {
  47. 'menuContent': {
  48. templateUrl: "templates/sessions.html",
  49. controller: 'SessionsCtrl'
  50. }
  51. }
  52. })
  53. .state('app.session', {
  54. url: "/sessions/:sessionId",
  55. views: {
  56. 'menuContent': {
  57. templateUrl: "templates/session.html",
  58. controller: 'SessionCtrl'
  59. }
  60. }
  61. });
  62. // if none of the above states are matched, use this as the fallback
  63. $urlRouterProvider.otherwise('/app/sessions');
  64. });