app.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // 'starter.controllers' is found in controllers.js
  2. angular.module('starter', ['ionic', 'starter.controllers'])
  3. .run(function($ionicPlatform) {
  4. $ionicPlatform.ready(function() {
  5. // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
  6. // for form inputs)
  7. if (window.cordova && window.cordova.plugins.Keyboard) {
  8. cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  9. }
  10. if (window.StatusBar) {
  11. // org.apache.cordova.statusbar required
  12. StatusBar.styleDefault();
  13. }
  14. });
  15. })
  16. .config(function($stateProvider, $urlRouterProvider) {
  17. $stateProvider
  18. .state('app', {
  19. url: "/app",
  20. abstract: true,
  21. templateUrl: "templates/menu.html",
  22. controller: 'AppCtrl'
  23. })
  24. .state('app.sessions', {
  25. url: "/sessions",
  26. views: {
  27. 'menuContent': {
  28. templateUrl: "templates/sessions.html",
  29. controller: 'SessionsCtrl'
  30. }
  31. }
  32. })
  33. .state('app.githubUser', {
  34. url: "/githubUser",
  35. views: {
  36. 'menuContent': {
  37. templateUrl: "templates/githubUser.html",
  38. controller: 'githubUserCtrl'
  39. }
  40. }
  41. })
  42. // if none of the above states are matched, use this as the fallback
  43. $urlRouterProvider.otherwise('/app/sessions');
  44. });