angular.module('app').run(['$rootScope', '$state', '$stateParams',
    function($rootScope, $state, $stateParams) {
        $rootScope.$state = $state;
        $rootScope.$stateParams = $stateParams;
    }
]).config(['$stateProvider', '$urlRouterProvider',
    function($stateProvider, $urlRouterProvider) {
        $urlRouterProvider.otherwise('/tabview/iPhone');
        $stateProvider
            .state('tabview', {
                controller: 'TabController',
                url: '/tabview',
                templateUrl: 'templates/tabview.html'
            })
            .state('tabview.iPhone', {
                controller: 'CarouselController',
                url: '/iPhone',
                templateUrl: 'templates/guideview.html',
                data: {
                    imgDir: '../img/iPhone/',
                    count: 7
                }
            })
            .state('tabview.android', {
                controller: 'CarouselController',
                url: '/android',
                templateUrl: 'templates/guideview.html',
                data: {
                    imgDir: '../img/android/',
                    count: 9
                }
            })
            .state('happynewyear', {
                controller: 'TabController',
                url: '/happynewyear',
                templateUrl: 'templates/happynewyear.html',
                data: {}
            });
    }
])