angular.module('appMessage').run(['$rootScope', '$state', '$stateParams',
    function($rootScope, $state, $stateParams) {
        $rootScope.$state = $state;
        $rootScope.$stateParams = $stateParams;
    }
]).config(['$stateProvider', '$urlRouterProvider', '$compileProvider',
    function($stateProvider, $urlRouterProvider, $compileProvider) {
        $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|local):/);
        $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|local):/);
        $urlRouterProvider.otherwise('/groupsInfo'); //
        $stateProvider.state('messages', {
                url: '/messages',
                templateUrl: 'templates/messages.html',
                controller: 'MessageController'
            })
            .state('transmitter', {
                url: '/transmitter',
                templateUrl: 'templates/transmitter.html',
                controller: 'TransmitterController'
            })
            .state('details', {
                url: '/details',
                templateUrl: 'templates/details-right.html',
                controller: 'UserController'
            })
            .state('smsSend', {
                url: '/smsSend',
                templateUrl: 'templates/smsSend.html',
                controller: 'SmsController'
            })
            .state('historyMsg', {
                url: '/historyMsg',
                templateUrl: 'templates/historyMsg.html',
                controller: 'HistoryMsgController'
            }).state('groupsInfo', {
                url: '/groupsInfo',
                templateUrl: 'templates/groupsInfo.html',
                controller: 'GroupsinfoController'
            });
    }
]);