AngularJS provides a way to include other external HTML fragments in our pages. The
directive allows the fragmentation and reuse of the application layout and is an important concept to explore.
HTML does not support embedding external html pages. It can be achieved in the following ways.
|Ajax||The most common way is to use an http request (AJAX) to get the corresponding html page and set it in innerHTML of an html element.|
|Server Side Includes||JSP, PHP and other web side server technologies can include html pages within a dynamic page.|
The following is an example code for the usage of the ngInclude directive: