Categories: AngularJS

Include files on AngularJS

Share

In HTML you can not include files like HTML into another HTML pages. To achieve this functionality you had to choose either Ajax call or server side includes like php, jsp.

But using AngularJS you can embed HTML page within a HTML page using ng-include directive.

By default, for same domain and protocol as a application document, the template URL is restricted.

For detail documentation click here.

Include files example:

<div ng-app="" ng-controller="userController">
   <div ng-include="'header.htm'"></div>
   <div>...</div>
   <div ng-include="'footer.htm'"></div>
</div>

Read Also: Ajax call – AngularJS

Recent Posts

The Rise of NFTs: Exploring the Impact of Non-Fungible Tokens on the Digital Economy

NFTs, or Non-Fungible Tokens, are revolutionizing the digital economy. These unique digital assets, authenticated through…

10 hours ago

Unveiling the Truth: Is the Spread of Sinus Infections a Myth or Reality?

Sinus infections, impacting approximately 31 million Americans each year, represent a significant health concern stemming…

2 days ago

Best Exercises To Reduce Weight & Keep You Stronger & Fitter!

No doubt that balanced weight is the key to wellness. So, when it comes to…

2 days ago

ARTIFICIAL INTELLIGENCE: Advantages And Disadvantages? Everything You Need to Know

Pros And Cons Of AI: Artificial Intelligence directly translates to conceptualizing and building machines that…

2 days ago

Four common mistakes when picking an internet provider

We all live on the internet; we use it for everything. Thus, when it comes…

2 days ago

What Is Commonly Misdiagnosed as Pink Eye: Understanding Eye Conditions and Their Symptoms

Introduction: Pink eye, or conjunctivitis, is a common eye condition characterized by redness and inflammation…

2 days ago