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('/peer'); //
        $stateProvider.state('peer', {
                url: '/peer',
                templateUrl: 'templates/peer.html',
                controller: 'PeerController'
            });
    }
])