How to retrieve some data from modal view

Hello,
i have a view that contains a user id.i want to pass that user id to the view after closemodal().i tried with $state.go with params but didn’t work
here it is

$scope.goToState1 = function () {
    $state.go('details',{user: $scope.user, email: $scope.email});
}

thank you for any help