From eb53423a41136fcda0c5e711f2d104952080354b Mon Sep 17 00:00:00 2001 From: Luis Ramón López Date: Thu, 21 Feb 2013 21:56:40 +0100 Subject: 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. --- docs/content/guide/directive.ngdoc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/content/guide') 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. -- cgit v1.2.3