定义和用法
在ng-include
指令包括从外部文件HTML。
所包含的内容将作为指定元素的子节点。
所述的值ng-include
属性也可以是一个表达,并返回一个文件名。
默认情况下,包含文件必须位于同一个域中的文件。
句法
< element ng-include=" filename " onload=" expression "
autoscroll=" expression " ></ element >
在NG-include指令也可以用来作为一个元素:
<ng-include src=" filename " onload=" expression "
autoscroll=" expression " ></ng-include>
所有HTML元素的支持。
参数值
Value | Description |
---|---|
filename | A filename, written with apostrophes, or an expression which returns a filename. |
onload | Optional. An expression to evaluate when the included file is loaded. |
autoscroll | Optional. Whether or not the included section should be able to scroll into a specific view. |