diff --git a/docs/content/guide/directive.ngdoc b/docs/content/guide/directive.ngdoc index c83215ade216..fda6fc8d89cd 100644 --- a/docs/content/guide/directive.ngdoc +++ b/docs/content/guide/directive.ngdoc @@ -909,6 +909,32 @@ Looking back at `myPane`'s definition, notice the last argument in its `link` fu When a directive requires a controller, it receives that controller as the fourth argument of its `link` function. Taking advantage of this, `myPane` can call the `addPane` function of `myTabs`. +If multiple controllers are required, the `require` option of the directive can take an array argument. The +corresponding paramater being sent to the `link` function will also be an array. + + + + angular.module('docsTabsExample', []) + .directive('myPane', function() { + return { + require: ['^myTabs', '^ngModel'], + restrict: 'E', + transclude: true, + scope: { + title: '@' + }, + link: function(scope, element, attrs, controllers) { + var tabsCtrl = controllers[0], + modelCtrl = controllers[1]; + + tabsCtrl.addPane(scope); + }, + templateUrl: 'my-pane.html' + }; + }); + + + Savvy readers may be wondering what the difference is between `link` and `controller`. The basic difference is that `controller` can expose an API, and `link` functions can interact with controllers using `require`.