In this tutorial we are going to learn how to setup angular-js environment on localhost as well as using CDN(content delivery networks).
AngularJS environment on localhost
You can download angular-js package from http://angularjs.org/. The package will consist of directory with name angular-1.x.x which consist of various angularjs scripts from their you have to link either angular.js or angular.min.js file by giving the correct path while you can also link other scripts according to your needs. Example for the same is shown below:
<head> <script src="angular-1.x.x/angular.min.js"> </script> </head>
<head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.6/angular.min.js"> </script> </head>
AngularJS is based on MVC framework in which M is for model, V is for view and C is for controller -:
Model: manages the application data
View: displays the application data
Controller: take input and handle the application data
Advantages of AngularJS
1- Helps in creating single page applications.
2- provides reusability
3- helps in embedding html templates within another html templates.
4- reduces the code length, especially in case of form validation.
Disadvantages of AngularJS
2- AngularJS is not secure, server side authentication is required.