diff options
| author | Luis Ramón López | 2013-02-21 21:56:40 +0100 |
|---|---|---|
| committer | Igor Minar | 2013-02-27 17:57:59 -0800 |
| commit | eb53423a41136fcda0c5e711f2d104952080354b (patch) | |
| tree | f86eca5ac62d80a8f48af8da9ae26c58d194c477 /docs | |
| parent | 5e18a15fb01d2e81adda68503754289fa9655082 (diff) | |
| download | angular.js-eb53423a41136fcda0c5e711f2d104952080354b.tar.bz2 | |
feat($compile): support for dynamic template generation
`template` and `templateUrl` properties can now be optionally defined
via a function. This allows templates to be dynamically generated on
the fly.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/guide/directive.ngdoc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/content/guide/directive.ngdoc b/docs/content/guide/directive.ngdoc index 59b89b40..2253ea30 100644 --- a/docs/content/guide/directive.ngdoc +++ b/docs/content/guide/directive.ngdoc @@ -406,10 +406,18 @@ compiler}. The attributes are: migrates all of the attributes / classes from the old element to the new one. See the {@link guide/directive#Components Creating Components} section below for more information. + 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. + * `templateUrl` - Same as `template` but the template is loaded from the specified URL. Because the template loading is asynchronous the compilation/linking is suspended until the template is loaded. + You can specify `templateUrl` as a string representing the URL 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 url. + * `replace` - if set to `true` then the template will replace the current element, rather than append the template to the element. |
