Advertisement
Guest User

app.js

a guest
Dec 15th, 2014
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. // Ionic Starter App
  2.  
  3. // angular.module is a global place for creating, registering and retrieving Angular modules
  4. // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
  5. // the 2nd parameter is an array of 'requires'
  6. // 'starter.controllers' is found in controllers.js
  7. angular.module('starter', ['ionic', 'starter.controllers','ngCordova'])
  8.  
  9. .run(function($ionicPlatform) {
  10. $ionicPlatform.ready(function() {
  11. // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
  12. // for form inputs)
  13.  
  14.  
  15. if (window.cordova && window.cordova.plugins.Keyboard) {
  16. cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  17. }
  18. if (window.StatusBar) {
  19. // org.apache.cordova.statusbar required
  20. StatusBar.styleDefault();
  21. }
  22. });
  23. })
  24.  
  25. .config(['$stateProvider', '$urlRouterProvider',function($stateProvider, $urlRouterProvider) {
  26. $stateProvider
  27.  
  28.  
  29. .state('app', {
  30. url: "/app",
  31. abstract: true,
  32. templateUrl: "templates/menu.html",
  33. controller: 'AppCtrl'
  34. })
  35. .state('app.search', {
  36. url: "/search",
  37. views: {
  38. 'menuContent': {
  39. templateUrl: "templates/search.html"
  40. }
  41. }
  42. })
  43.  
  44. .state('app.browse', {
  45. url: "/browse",
  46. views: {
  47. 'menuContent': {
  48. templateUrl: "templates/browse.html"
  49. }
  50. }
  51. })
  52. .state('app.playlists', {
  53. url: "/playlists",
  54. views: {
  55. 'menuContent': {
  56. templateUrl: "templates/playlists.html",
  57. controller: 'PlaylistsCtrl'
  58. }
  59. }
  60. })
  61.  
  62. .state('app.single', {
  63. url: "/playlists/:playlistId",
  64. views: {
  65. 'menuContent': {
  66. templateUrl: "templates/playlist.html",
  67. controller: 'PlaylistCtrl'
  68. }
  69. }
  70. })
  71. .state('signup', {
  72. url: "/signup",
  73. templateUrl: "templates/signup.html",
  74. controller: 'AppCtrl'
  75.  
  76.  
  77. });
  78. // if none of the above states are matched, use this as the fallback
  79. // $urlRouterProvider.otherwise('/app/playlists');
  80. var user_auth=false;
  81. if (user_auth) {
  82. $urlRouterProvider.otherwise('/app/search');
  83.  
  84. } else{
  85. $urlRouterProvider.otherwise('/signup');
  86. };
  87. }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement