How to Include AngularJS Library in Web page via CDN ?

If you want to use AngularJS library in a web page , we just have to point your script tag to the necessary AngularJS script file .

You can either download the AngularJS script file to your server and use it or else you can use the CDN(Content Delivery Network).

In this article , we will look in to the inclusion of the AngularJS in a web page using CDN.

How to Include AngularJS Library in Web page via CDN ?

Just add the below script in the head tag of your HTML page to start with.

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js">

Note that the version number of angularjs that is used in the above code snippet is 1.4.9.

Once this is done , use the np-app directive to tell the HTML page to kick start the AngularJS feature.

<body ng-app>
</body>

Below is a sample Html page using AngularJS

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js">
</script>
</head>
<body ng-app>
<p>Name : <input type="text" ng-model="name" placeholder="Enter the name"></p>
<h1>Hello {{name}}</h1>
</body>
</html>