$location.url()
By using $location.url() one can add parameters inside the url function.
But If someone wants to add some params to it like this '/details/student
You need to define router for that like following :-
$stateProvider
//considering route.state is your current state and you need to go on student
.state(route.state + '.student', {
url: '/student',
templateUrl: 'app/examples/student/student.tmpl.html',
controller: 'StudentController'
});
Then inside your details controller you need to move to student like following
$scope.baseState.name = $state.current;
$state.go($scope.baseState.name + '.student');