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

Commit d259754

Browse files
Izhakibtford
authored andcommitted
docs($compile): fix template and replace properties' docs
Closes #8062
1 parent 1c9ab40 commit d259754

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
@@ -233,14 +233,16 @@
233233
* If no `type` is specified, then the type is considered to be html.
234234
*
235235
* #### `template`
236-
* replace the current element with the contents of the HTML. The replacement process
237-
* migrates all of the attributes / classes from the old element to the new one. See the
238-
* {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive
239-
* Directives Guide} for an example.
236+
* HTML markup that may:
237+
* * Replace the contents of the directive's element (defualt).
238+
* * Replace the directive's element itself (if `replace` is true - DEPRECATED).
239+
* * Wrap the contents of the directive's element (if `transclude` is true).
240+
*
241+
* Value may be:
240242
*
241-
* You can specify `template` as a string representing the template or as a function which takes
242-
* two arguments `tElement` and `tAttrs` (described in the `compile` function api below) and
243-
* returns a string value representing the template.
243+
* * A string. For example `<div red-on-hover>{{delete_str}}</div>`.
244+
* * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`
245+
* function api below) and returns a string value.
244246
*
245247
*
246248
* #### `templateUrl`
@@ -255,11 +257,14 @@
255257
*
256258
*
257259
* #### `replace` ([*DEPRECATED*!], will be removed in next major release)
258-
* specify where the template should be inserted. Defaults to `false`.
260+
* specify what the template should replace. Defaults to `false`.
259261
*
260-
* * `true` - the template will replace the current element.
261-
* * `false` - the template will replace the contents of the current element.
262+
* * `true` - the template will replace the directive's element.
263+
* * `false` - the template will replace the contents of the directive's element.
262264
*
265+
* The replacement process migrates all of the attributes / classes from the old element to the new
266+
* one. See the {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive
267+
* Directives Guide} for an example.
263268
*
264269
* #### `transclude`
265270
* compile the content of the element and make it available to the directive.

0 commit comments

Comments
 (0)