Angularjs Examples

AJS Examples


AngularJS ng-Include Directive

The AngularJS ng-include directive is used to include an external HTML fragment to your page.

Syntax

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

AngularJS ng-Include Directive Example

<html>
<head>
<title>My first AngularJS ng-include Directive code</title>
<Script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</Script>
<Script type="text/ng-template" id="http://www.techstrikers.com/AngularJS/htmlPage1.html">
</Script>
<Script type="text/ng-template" id="http://www.techstrikers.com/AngularJS/htmlPage2.html">
</Script>
</head>
<body>
<div ng-app="">

<ng-include src="'http://www.techstrikers.com/AngularJS/htmlPage1.html'"></ng-include>
<ng-include src="'http://www.techstrikers.com/AngularJS/htmlPage2.html'"></ng-include>
		
</div>
</body>
</html>
See Live Example