commonroutesServer/app/www/js/app.js
app/www/js/app.jsRaw
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
7angular.module('starter', ['ionic', 'starter.controllers'])
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 if (window.cordova && window.cordova.plugins.Keyboard) {
14 cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
15 cordova.plugins.Keyboard.disableScroll(true);
16
17 }
18 if (window.StatusBar) {
19 // org.apache.cordova.statusbar required
20 StatusBar.styleDefault();
21 }
22 });
23})
24
25.config(function($stateProvider, $urlRouterProvider) {
26 $stateProvider
27
28 .state('app', {
29 url: '/app',
30 abstract: true,
31 templateUrl: 'templates/menu.html',
32 controller: 'AppCtrl'
33 })
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.travels', {
53 url: '/travels',
54 views: {
55 'menuContent': {
56 templateUrl: 'templates/travels.html',
57 controller: 'TravelsCtrl'
58 }
59 }
60 })
61
62 .state('app.single', {
63 url: '/travels/:travelId',
64 views: {
65 'menuContent': {
66 templateUrl: 'templates/travel.html',
67 controller: 'TravelCtrl'
68 }
69 }
70 });
71 // if none of the above states are matched, use this as the fallback
72 $urlRouterProvider.otherwise('/app/travels');
73});