How to pass data between controller/view in Ionic?

I am using Ionic and Angular to create a mobile application and need to pass data between two controllers/views.

.controller('SearchCtrl', function($scope, $state, $http) {
    $scope.search = function() {
        console.log('Starting search..');
        var res = $http.post('http://endpoint:8080/search',{"language":"en"})
            .success(function(data) {
            //take the data.results and make sure its available when I move to tab.search-results   
            alert("Search OK");
        })
            .error(function(data) {
            alert("Search Bad");
        });

        //take the data.results and make sure its available when I move to tab.search-results
        $state.go('tabs.search-results');
    };
})

So when I do the $state.go('tabs.search-results') I want to make sure the data returned from search is available for loading in the new view. This is probably really obvious but I am struggling to find a solution.

You can pass the data in the go method as the second argument, so

.controller('SearchCtrl', function($scope, $state, $http) {
    $scope.search = function() {
        console.log('Starting search..');
        var res = $http.post('http://endpoint:8080/search',{"language":"en"})
            .success(function(data) {
                alert("Search OK");
                //take the data.results and make sure its available when I move to tab.search-results
                $state.go('tabs.search-results', {result: data});
            }).error(function(data) {
                alert("Search Bad");
            });
    };
})    

Then in the search results controller you can access the data from the $stateParams service.

.controller('SearchResultsCtrl', function($scope, $state, $stateParams) {

    $scope.results = $stateParams.result;

});