app.js 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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','starter.directives'])
  8. // angular.module('starter', ['ionic', 'starter.controllers', 'restangular', 'oc.lazyLoad'])
  9. // angular.module('starter', ['ionic', 'starter.controllers', 'restangular', 'oc.lazyLoad', 'formly', 'formlyBootstrap'])
  10. angular.module('starter', ['ionic', 'starter.controllers', 'restangular', 'oc.lazyLoad'])
  11. // .run(['$rootScope', function($rootScope) {
  12. // $rootScope.onibaritems = [
  13. // { title: "首页", href: "#/tab/Home" },
  14. // { title: "聊天", href: "#/tab/chats" }
  15. // ]
  16. // }])
  17. // .run(function($ionicPlatform) {
  18. // $ionicPlatform.ready(function() {
  19. // // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
  20. // // for form inputs)
  21. // if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
  22. // cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  23. // cordova.plugins.Keyboard.disableScroll(true);
  24. // }
  25. // if (window.StatusBar) {
  26. // // org.apache.cordova.statusbar required
  27. // StatusBar.styleDefault();
  28. // }
  29. // });
  30. // })
  31. .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
  32. $ionicConfigProvider.platform.ios.tabs.style('standard');
  33. $ionicConfigProvider.platform.ios.tabs.position('bottom');
  34. $ionicConfigProvider.platform.android.tabs.style('standard');
  35. $ionicConfigProvider.platform.android.tabs.position('bottom');
  36. // Ionic uses AngularUI Router which uses the concept of states
  37. // Learn more here: https://github.com/angular-ui/ui-router
  38. // Set up the various states which the app can be in.
  39. // Each state's controller can be found in controllers.js
  40. $stateProvider
  41. // setup an abstract state for the tabs directive
  42. .state('tab', {
  43. url: '/tab',
  44. abstract: true,
  45. templateUrl: 'ionic/templates/tabs.html'
  46. })
  47. // Each tab has its own nav history stack:
  48. .state('tab.dash', {
  49. url: '/dash',
  50. views: {
  51. 'tab-dash': {
  52. templateUrl: 'ionic/templates/tab-dash.html',
  53. controller: 'DashCtrl'
  54. }
  55. }
  56. })
  57. // .state('tab.chats', {
  58. // url: '/chats',
  59. // views: {
  60. // 'tab-chats': {
  61. // templateUrl: 'templates/tab-chats.html',
  62. // controller: 'ChatsCtrl'
  63. // }
  64. // }
  65. // })
  66. // .state('tab.chat-detail', {
  67. // url: '/chats/:chatId',
  68. // views: {
  69. // 'tab-chats': {
  70. // templateUrl: 'templates/chat-detail.html',
  71. // controller: 'ChatDetailCtrl'
  72. // }
  73. // }
  74. // })
  75. // .state('tab.account', {
  76. // url: '/account',
  77. // views: {
  78. // 'tab-account': {
  79. // templateUrl: 'templates/tab-account.html',
  80. // controller: 'AccountCtrl'
  81. // }
  82. // }
  83. // });
  84. // if none of the above states are matched, use this as the fallback
  85. $urlRouterProvider.otherwise('/tab/dash');
  86. });