Subversion Repositories SmartDukaan

Rev

Rev 13551 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13542 anikendra 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.services' is found in services.js
7
// 'starter.controllers' is found in controllers.js
8
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'starter.filters', 'LocalStorageModule','ngResource'])
9
 
10
.run(function($ionicPlatform) {
11
  $ionicPlatform.ready(function() {
12
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
13
    // for form inputs)
14
    if (window.cordova && window.cordova.plugins.Keyboard) {
15
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
16
    }
17
    if (window.StatusBar) {
18
      // org.apache.cordova.statusbar required
19
      StatusBar.styleDefault();
20
    }
21
  });
22
})
23
 
24
.config(function($stateProvider, $urlRouterProvider) {
25
 
26
  // Ionic uses AngularUI Router which uses the concept of states
27
  // Learn more here: https://github.com/angular-ui/ui-router
28
  // Set up the various states which the app can be in.
29
  // Each state's controller can be found in controllers.js
30
  $stateProvider
31
 
32
  // setup an abstract state for the tabs directive
33
  .state('tab', {
34
    url: "/tab",
35
    abstract: true,
36
    templateUrl: "templates/tabs.html"
37
  })
38
 
39
  // Each tab has its own nav history stack:
40
 
41
  .state('tab.dash', {
42
    url: '/dash',
43
    views: {
44
      'tab-dash': {
45
        templateUrl: 'templates/tab-dash.html',
46
        controller: 'DashCtrl'
47
      }
48
    }
49
  })
50
 
51
  .state('tab.chats', {
52
      url: '/chats',
53
      views: {
54
        'tab-chats': {
55
          templateUrl: 'templates/tab-chats.html',
56
          controller: 'ChatsCtrl'
57
        }
58
      }
59
    })
60
    .state('tab.chat-detail', {
61
      url: '/chats/:chatId',
62
      views: {
63
        'tab-chats': {
64
          templateUrl: 'templates/chat-detail.html',
65
          controller: 'ChatDetailCtrl'
66
        }
67
      }
68
    })
69
 
70
  .state('tab.friends', {
71
      url: '/friends',
72
      views: {
73
        'tab-friends': {
74
          templateUrl: 'templates/tab-friends.html',
75
          controller: 'FriendsCtrl'
76
        }
77
      }
78
    })
79
    .state('tab.friend-detail', {
80
      url: '/friend/:friendId',
81
      views: {
82
        'tab-friends': {
83
          templateUrl: 'templates/friend-detail.html',
84
          controller: 'FriendDetailCtrl'
85
        }
86
      }
87
    })
88
 
89
  .state('tab.login', {
90
    url: '/login',
91
    views: {
92
      'tab-login': {
93
        templateUrl: 'templates/tab-login.html',
94
        controller: 'LoginCtrl'
95
      }
96
    }
97
  })
98
 
99
  .state('tab.account', {
100
    url: '/account',
101
    views: {
102
      'tab-account': {
103
        templateUrl: 'templates/tab-account.html',
104
        controller: 'AccountCtrl'
105
      }
106
    }
107
  });
108
 
109
  // if none of the above states are matched, use this as the fallback
110
  $urlRouterProvider.otherwise('/tab/dash');
111
 
112
});