ngInclude
ng
Fetches, compiles and includes an external HTML fragment.
Keep in mind that:
$sce.getTrustedResourceUrl
on it. To load templates from other domains and/or protocols,
you may either either whitelist them
or
wrap it
into a trusted value. Refer Angular's Strict Contextual Escaping
.file://
access on some browsers)This directive can be used as custom element, but be aware of IE restrictions.
as element:<ng-include src="{string}" [onload="{string}"] [autoscroll="{string}"]> </ng-include>as attribute
<ANY ng-include="{string}" [onload="{string}"] [autoscroll="{string}"]> ... </ANY>as class
<ANY class="ng-include: {string}; [onload: {string};] [autoscroll: {string};]"> ... </ANY>
Param | Type | Details |
---|---|---|
ngInclude|src | string | angular expression evaluating to URL. If the source is a string constant,
make sure you wrap it in quotes, e.g. |
onload (optional) | string | Expression to evaluate when a new partial is loaded. |
autoscroll (optional) | string | Whether
|
Emitted every time the ngInclude content is reloaded.
Emitted every time the ngInclude content is requested.