Instrukcja AngularJS ng-include

Definicja i użycie

ng-include Instrukcja zawiera HTML z pliku zewnętrznego.

Zawartość ta będzie zawarta jako podwórze elementu wskazanego.

ng-include Wartość atrybutu może być również wyrażeniem, zwracającym nazwę pliku.

By default, the included file must be located in the same domain as the document.

Example

Include HTML from an external file:

<div ng-include="'myFile.htm'"></div>

Try it yourself

Syntax

<element ng-include="filename" onload="expression" autoscroll="expression" ></element>

ng-include Directives can also be used as elements:

<ng-include src="filename" onload="expression" autoscroll="expression" ></ng-include>

All HTML elements support.

Parameters

Parameters Description
filename Filename, enclosed in apostrophes, or an expression that returns the filename.
onload Optional. Expressions to be calculated when loading the included file.
autoscroll Optional. Whether the included part should scroll to a specific view.