mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-03 22:44:00 +08:00
@@ -233,14 +233,16 @@
|
||||
* If no `type` is specified, then the type is considered to be html.
|
||||
*
|
||||
* #### `template`
|
||||
* replace the current element with the contents of the HTML. The replacement process
|
||||
* migrates all of the attributes / classes from the old element to the new one. See the
|
||||
* {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive
|
||||
* Directives Guide} for an example.
|
||||
* HTML markup that may:
|
||||
* * Replace the contents of the directive's element (defualt).
|
||||
* * Replace the directive's element itself (if `replace` is true - DEPRECATED).
|
||||
* * Wrap the contents of the directive's element (if `transclude` is true).
|
||||
*
|
||||
* You can specify `template` as a string representing the template or as a function which takes
|
||||
* two arguments `tElement` and `tAttrs` (described in the `compile` function api below) and
|
||||
* returns a string value representing the template.
|
||||
* Value may be:
|
||||
*
|
||||
* * A string. For example `<div red-on-hover>{{delete_str}}</div>`.
|
||||
* * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`
|
||||
* function api below) and returns a string value.
|
||||
*
|
||||
*
|
||||
* #### `templateUrl`
|
||||
@@ -255,11 +257,14 @@
|
||||
*
|
||||
*
|
||||
* #### `replace` ([*DEPRECATED*!], will be removed in next major release)
|
||||
* specify where the template should be inserted. Defaults to `false`.
|
||||
* specify what the template should replace. Defaults to `false`.
|
||||
*
|
||||
* * `true` - the template will replace the current element.
|
||||
* * `false` - the template will replace the contents of the current element.
|
||||
* * `true` - the template will replace the directive's element.
|
||||
* * `false` - the template will replace the contents of the directive's element.
|
||||
*
|
||||
* The replacement process migrates all of the attributes / classes from the old element to the new
|
||||
* one. See the {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive
|
||||
* Directives Guide} for an example.
|
||||
*
|
||||
* #### `transclude`
|
||||
* compile the content of the element and make it available to the directive.
|
||||
|
||||
Reference in New Issue
Block a user