I do not fully understand your question. Are you asking how to ALWAYS store the new data in your variable? Just remove the if statement.
$scope.setContent = function (data) {
        $scope.unfiltered_tree = data;
   }
The purpose of the if statement may have been to check if your variable has been intialized or not. In that case you may want to use the following format:
$scope.setContent = function (data) {
        if (!$scope.unfiltered_tree) {
            // Variable has not been initialized yet
            $scope.unfiltered_tree = data;
        } else {
            // Variable has been initialized before, do something else
          }
   }