I have a problem. I am trying to implement a global search function on my website and am having some problem getting the data over. I have in one file:

```
/*index.html*/
<div ng-controller="ControllerOfFileIWantToGoTo">
    <input type="text" class="form-control" placeholder="Search..." ng-model="search"></input>
    <button class="btn btn-default" type="button" ng-click="searchValue(search);">
        <i class="fa fa-search"></i>
    </button>
</div>

```

Inside the JS file with the controller "ControllerOfFileIWantToGoTo" I simply have:

```
/*FileIWantToGoTo.js*/
//$scope.search = ""; //I did not include this

console.log($scope.search);

$scope.searchValue = function(value){
    $location.path('/url');
    // Once loaded, do this
    $scope.search = value; //this never seems to get done
}

```

And the HTML associated with this page, has:

```
<!-- FileIWantToGoTo.html -->
<label>I am searching for {{search}}!</label>

```

Whenever I run this though, search is never updated. I do not set the $scope.search variable because I think any null value will overwrite the value I give it. It only navigates to the page an stops. How do I make it so that this can both navigate to the page AND update the "search" variable?

Also, I did try $apply(), but I received an error saying that it was already in use.