定義和用法
在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. |