Include

Using AngularJS, we can include or embed Html pages within an Html page using ng-include directive.
Html does not support include or embed Html pages within the html page. To achieve this functionality, you need to use following technologies.
  • Ajax :Use Ajax to fetch data from a server, and then write the data to the inner HTML of an HTML element.
  • Server Side Technologies: JSP, PHP and some other server side technologies are use for include or add Html page within a dynamic page.

AngularJS Side Includes

Using AngularJS, we can include or embed Html pages within an Html page using ng-include directive.

Example

<div class="container">
  <div ng-include="'header.html'"></div>
  <div ng-include="'footer.html'"></div>
</div>