app.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.snippets', {
  25. url: "/snippets",
  26. views: {
  27. 'menuContent': {
  28. templateUrl: "templates/snippets.html",
  29. controller: 'SnippetsCtrl'
  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. .state('app.instagramUser',{
  43. url: "/instagramUser",
  44. views: {
  45. 'menuContent': {
  46. templateUrl: 'templates/instagramUser.html',
  47. controller: 'instagramUserCtrl'
  48. }
  49. }
  50. })
  51. .state('app.steamSales', {
  52. url: '/steamSales',
  53. views: {
  54. 'menuContent': {
  55. templateUrl: 'templates/steamSales.html',
  56. controller: 'steamSalesCtrl'
  57. }
  58. }
  59. });
  60. // if none of the above states are matched, use this as the fallback
  61. $urlRouterProvider.otherwise('/app/snippets');
  62. });