View source Improve this doc

script
directive in module ng

Description

Load the content of a <script> element into $templateCache, so that the template can be used by ngInclude, ngView, or directives. The type of the <script> element must be specified as text/ng-template, and a cache name for the template must be assigned through the element's id, which can then be used as a directive's templateUrl.

Usage

This directive can be used as custom element, but be aware of IE restrictions.

as element:
<script
       type="text/ng-template"
       id="{string}">
</script>

Parameters

ParamTypeDetails
type'text/ng-template'

Must be set to 'text/ng-template'.

idstring

Cache name of the template.

Example

Source




  Load inlined template
  


Demo