Question: I have two element-level directives, a search box and a search results. My markup is something like this (simplified):

```
<catalogue-search-box query="{{query}}">
<catalogue-search-results></catalogue-search-results>

```

I'm trying to access the search box controller from the search results directive, but the documentation suggests that in the directive's require property I can only find controllers on the same element or on the parent element. Is there a way to find controllers on adjacent elements?

Answer: 
After you comments here is how I would do it: use an object to hold all your state and pass it to both directives. [Demo plunker](http://plnkr.co/edit/KSsavZ7Hi9yOWezLuAIC?p=preview)

**HTML**

```
<body ng-controller="MySearchController">
  <search-box search="mySearch"></search-box>
  <search-results search="mySearch"></search-results>
</body>

```

**JS**

```
var search = angular.module('search', []);

//simulated service
search.service('Search', ['$timeout', '$q', function($timeout, $q) {
  return {
    findByQuery : function(query) {
      var deferred = $q.defer();
      $timeout(function() {
        deferred.resolve([query + ' result1', query + ' result2']);
        console.log('resolved query ' + query);
      }, 2000);
      return deferred.promise;
    }
  };  
}]);

search.controller('MySearchController', ['$scope', function($scope) {
  $scope.mySearch = {
    query : ''
  }
}]);

search.controller('SearchBoxCtrl', ['$scope', 'Search', function($scope, Search) {
  $scope.execute = function(search) {
    console.log(search);
    if(search.query && search.query.length > 3 && !search.running) {
      search.running = true;
      search.promise = Search.findByQuery(search.query).then(function(val) {
        search.results = val;
      });
    }
  };
}]);

search.directive('searchBox', function(){
  return {
    restrict: 'E',
    scope : {
      search : '='
    },
    controller: 'SearchBoxCtrl',
    template : '<div ng-hide="search.results">Query: <input type="text" ng-model="search.query" ng-disabled="search.running"></input> <button ng-click="execute(search)" ng-disabled="search.running">Search</button></div>',
    replace: 'true'
  };
});

search.controller('SearchResultsCtrl', function(){

});

search.directive('searchResults', function(){
  return {
    restrict: 'E',
    scope : {
      search : '='
    },
    controller: 'SearchResultsCtrl',
    template : '<div ng-show="search.results"><div ng-repeat="result in search.results">{{result}}</div></div>',
    replace: true,
    link : function(scope, element, attrs, ctrl){
    }
  };
});

```

**PS**: 

1. ***Don't use** p tags in directive templates as the root node. The html parser reports 2 nodes if you have p child nodes and angular has a requirement for a single root node.*
2. *You can further use the promise in the controller to register other functions to execute when the results come in.*
One way I've been experimenting with since the question is having some kind of controller directive i.e.

```
<catalogue-search>
    <catalogue-search-box query="{{query}}">
    <catalogue-search-results></catalogue-search-results>
</catalogue-search>

```

I can then access the "controller directive" this using the parent (^) modifier in my require statement. Each directive can then talk to each other via the controller directive.

Does this seem sensible or is it overcomplicating things?