# Pastebin NpMp0dAz $urlRouterProvider.otherwise(''); $stateProvider.state("noEmployee", { url: "", template: '', controller: ['$rootScope', '$state', '$scope', 'userService', function ($rootScope, $state, $scope, userService) { userService.getCurrentUser().then(function (currentUser) { // $state.transitionTo('employee.personaldetails', { EmployeeID: currentUser.EmployeeID }, { reload: true }); console.log("going" + currentUser.EmployeeID); $state.go('employee.personaldetails', { EmployeeID: currentUser.EmployeeID }); }.bind(this)); } ] })