AngularJS Environment Setup

If you are wondering what all you require to set up AngularJS on your system, then you have nothing to worry about. As and when you go through the examples while you read, you will find an option "Try It" in every program. you can even try and alter the example given and experiment your results with whatever you have in mind. Hence, you don't have to set up any such environment as you have one online already.

Looking at the following example.

<!doctype html>
<html ng-app>
   
   <head>
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>
   </head>
   
   <body>
      <div>
         <label>Name:</label>
         <input type = "text" ng-model = "yourName" placeholder = "Enter a name here">
         <hr />
         
         <h1>Hello {{yourName}}!</h1>
     </div>
      
   </body>
</html>

Setting up the library

While you already have a convenient environment online, you however need to set up the AngularJS library which is to be used in web application development. Once we are done with that, let us also look at the directory structure and the contents of it.

Access the link https://angularjs.org/ and you will find two options related to AngularJS.


1. Download AngularJS 1 Or, you could click on this button to download. When you do click on the download AngularJS 1 button, you will be given out a screen which gives you various options in which you can use AngularJS. They are:

Download AngularJS

2. View on GitHub - You can click on this button to have access to all the latest scripts from GitHub


Download AngularJS click
  • Downloading and hosting files locally.
  • CDN access.

While the downloading host files has two variants such as legacy and latest which itself gives you a rough idea about the names. You also have option of uncompressed or zipped versions as well.

And, through the CDN option, you also have access to a CDN. The CDN in this case will give you access to a Google host. Using CDN takes you off the responsibility of hosting the files from your own servers.

You will find CDN versions of the library throughout the tutorials.