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('/home'); //
        $stateProvider.state('home', {
                url: '/home',
                templateUrl: 'templates/home.html',
                controller: 'HomeController'
            })
            .state('webChat', {
                url: '/webChat',
                templateUrl: 'templates/webChat.html',
                controller: 'WebController'
            })
            .state('webChat.conComplain', {
                url: '/conComplain',
                templateUrl: 'templates/webChat-1.html',
                controller: 'WebController'
            })
            .state('webChat.queryEv', {
                url: '/queryEv',
                templateUrl: 'templates/webChat-2.html',
                controller: 'WebController'
            })
            .state('webChat.dyInfo', {
                url: '/dyInfo',
                templateUrl: 'templates/webChat-3.html',
                controller: 'WebController'
            })
            .state('webChat.phoneLogin', {
                url: '/phoneLogin',
                templateUrl: 'templates/webChat-4.html',
                controller: 'WebController'
            }).state('webChat.online', {
                url: '/online',
                templateUrl: 'templates/webChat-5.html',
                controller: 'WebController'
            });
    }
]);