View difference between Paste ID: 2hvyRDic and 3RaXnS3v
SHOW: | | - or go back to the newest paste.
1
.config(function($stateProvider, $urlRouterProvider) {
2
3
  // Ionic uses AngularUI Router which uses the concept of states
4
  // Learn more here: https://github.com/angular-ui/ui-router
5
  // Set up the various states which the app can be in.
6
  // Each state's controller can be found in controllers.js
7
  $stateProvider
8
9
    // setup an abstract state for the tabs directive
10
    .state('tab', {
11
      url: "/tab",
12
      abstract: true,
13
      templateUrl: "templates/tabs.html"
14
    })
15
16
    // Each tab has its own nav history stack:
17
18
    .state('tab.dash', {
19
      url: '/dash',
20
      views: {
21
        'tab-dash': {
22
          templateUrl: 'templates/tab-dash.html',
23
          controller: 'DashCtrl'
24
        }
25
      }
26
    })
27
28-
    .state('tab.penis', {
28+
    .state('tab.product', {
29
      url: '/product/:slug',
30
      views: {
31
        'tab-product': {
32
          templateUrl: 'templates/tab-products.html',
33
          controller: 'ProductsCtrl'
34
        }
35
      }
36
    })
37
38
    .state('tab.products', {
39
      url: '/products',
40
      views: {
41
        'tab-products': {
42
          templateUrl: 'templates/tab-products.html',
43
          controller: 'ProductsCtrl'
44
        }
45
      }
46
    })
47
48
    .state('tab.about', {
49
      url: '/about',
50
      views: {
51
        'tab-about': {
52
          templateUrl: 'templates/tab-about.html',
53
          controller: 'AboutCtrl'
54
        }
55
      }
56
    });
57
58
  // if none of the above states are matched, use this as the fallback
59
  $urlRouterProvider.otherwise('/tab/dash');
60
61
});