app.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.services' is found in services.js
  6. // 'starter.controllers' is found in controllers.js
  7. angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
  8. .run(function($ionicPlatform) {
  9. $ionicPlatform.ready(function() {
  10. // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
  11. // for form inputs)
  12. if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
  13. cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  14. cordova.plugins.Keyboard.disableScroll(true);
  15. }
  16. if (window.StatusBar) {
  17. // org.apache.cordova.statusbar required
  18. StatusBar.styleDefault();
  19. }
  20. });
  21. })
  22. .config(function($stateProvider, $urlRouterProvider) {
  23. // Ionic uses AngularUI Router which uses the concept of states
  24. // Learn more here: https://github.com/angular-ui/ui-router
  25. // Set up the various states which the app can be in.
  26. // Each state's controller can be found in controllers.js
  27. $stateProvider
  28. // setup an abstract state for the tabs directive
  29. // Each tab has its own nav history stack:
  30. .state('login', {
  31. url: '/login',
  32. views: {
  33. '': {
  34. templateUrl: 'templates/login.html',
  35. controller: 'loginCtrl'
  36. }
  37. }
  38. })
  39. .state('home',{
  40. url:'/home',
  41. views:{
  42. '':{
  43. templateUrl:'templates/home.html',
  44. controller:'homeCtrl'
  45. }
  46. }
  47. })
  48. .state('show',{
  49. url:'/show',
  50. params:{item:null},
  51. templateUrl:'templates/show.html',
  52. controller:'showCtrl'
  53. })
  54. // if none of the above states are matched, use this as the fallback
  55. $urlRouterProvider.otherwise('/login');
  56. });