English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js></script> </head> <body ng-app=""> <div ng-include="'myFile.htm'"></div> </body> </html>Test and see ‹/›
ng-include The directive is used to include external HTML files.
The included content will be as a child node of the specified element.
ng-include
The value of the attribute can be an expression that returns a filename.
By default, the included files need to be included in the same domain.
<element ng-include="filename" onload="expression" autoscroll="expression" ></element>
ng-include directive as an element:
All HTML elements support this directive.
Value | Description |
---|---|
filename | Filename, a filename can be returned using an expression. |
onload | Optional, the expression to be executed after the file is loaded. |
autoscroll | Optional, whether the included part is scrollable on the specified view. |