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

Commit 6ce5a04

Browse files
Izhakibtford
authored andcommitted
docs($compile): fix template and replace properties' docs
Closes #8062
1 parent 929064d commit 6ce5a04

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/ng/compile.js

+15-10
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,16 @@
213213
*
214214
*
215215
* #### `template`
216-
* replace the current element with the contents of the HTML. The replacement process
217-
* migrates all of the attributes / classes from the old element to the new one. See the
218-
* {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive
219-
* Directives Guide} for an example.
216+
* HTML markup that may:
217+
* * Replace the contents of the directive's element (defualt).
218+
* * Replace the directive's element itself (if `replace` is true - DEPRECATED).
219+
* * Wrap the contents of the directive's element (if `transclude` is true).
220+
*
221+
* Value may be:
220222
*
221-
* You can specify `template` as a string representing the template or as a function which takes
222-
* two arguments `tElement` and `tAttrs` (described in the `compile` function api below) and
223-
* returns a string value representing the template.
223+
* * A string. For example `<div red-on-hover>{{delete_str}}</div>`.
224+
* * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`
225+
* function api below) and returns a string value.
224226
*
225227
*
226228
* #### `templateUrl`
@@ -235,11 +237,14 @@
235237
*
236238
*
237239
* #### `replace` ([*DEPRECATED*!], will be removed in next major release)
238-
* specify where the template should be inserted. Defaults to `false`.
240+
* specify what the template should replace. Defaults to `false`.
239241
*
240-
* * `true` - the template will replace the current element.
241-
* * `false` - the template will replace the contents of the current element.
242+
* * `true` - the template will replace the directive's element.
243+
* * `false` - the template will replace the contents of the directive's element.
242244
*
245+
* The replacement process migrates all of the attributes / classes from the old element to the new
246+
* one. See the {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive
247+
* Directives Guide} for an example.
243248
*
244249
* #### `transclude`
245250
* compile the content of the element and make it available to the directive.

0 commit comments

Comments
 (0)