Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 33d8a27

Browse files
author
Michael Salmon
committed
docs(guide/Directives):
Adds reference to $compile for link function parameters and gives quick intro to 5th param transcludeFn which was also missing in doc.
1 parent e6e8811 commit 33d8a27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/content/guide/directive.ngdoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,15 @@ want to reuse throughout your app.
587587
In this example we will build a directive that displays the current time.
588588
Once a second, it updates the DOM to reflect the current time.
589589

590-
Directives that want to modify the DOM typically use the `link` option.
591-
`link` takes a function with the following signature, `function link(scope, element, attrs, controller) { ... }`
592-
where:
590+
Directives that want to modify the DOM typically use the `link` option, which is documented on the {@link ng.$compile `$compile` API} page.
591+
`link` takes a function with the following signature, `function link(scope, element, attrs, controller, transcludeFn) { ... }`, where:
593592

594593
* `scope` is an Angular scope object.
595594
* `element` is the jqLite-wrapped element that this directive matches.
596595
* `attrs` is a hash object with key-value pairs of normalized attribute names and their
597596
corresponding attribute values.
598-
* `controller` is the controller for the directive, if defined
597+
* `controller` is the controller for the directive, if defined.
598+
* `transcludeFn` is a transclude linking function pre-bound to the correct translusion scope.
599599

600600
In our `link` function, we want to update the displayed time once a second, or whenever a user
601601
changes the time formatting string that our directive binds to. We will use the `$interval` service
@@ -998,7 +998,7 @@ angular.module('docsTabsExample', [])
998998
scope: {
999999
title: '@'
10001000
},
1001-
link: function(scope, element, attrs, controllers) {
1001+
link: function(scope, element, attrs, controllers, transcludeFn) {
10021002
var tabsCtrl = controllers[0],
10031003
modelCtrl = controllers[1];
10041004

0 commit comments

Comments
 (0)