Angularjs - Hello World!
What is Angularjs?
Google has made this project opensource which mean the source code is available for all. It can be re-modified and used for other projects. It is best fit for SPA (Single Page Application), MVC framework web application etc..,
Visit website Made With Angular (Click Here) to know the top websites which uses Angular JS.
Talking about benefits of Angular JS:
- Dependency Injection
- Two Way Data-Binding
- Testing
- ModelViewControler
- Directives, Filters etc.,
To get started you need to have angular.js file added to your project. You can download the file or use the CDN link.
Download AngularJS version 1.5.5 file from here
Google CDN Minified : https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js
Google Uncompressed : https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js
Why Google CDN?
While downloading and using the AngularJS source code is great for development, we recommend that you source the script from Google's CDN (Content Delivery Network) in your deployed, customer facing app whenever possible. You get the following advantages for doing so:
Better Caching : If you host AngularJS yourself, your users will have to download the source code atleast once. But if the browser sees that you are referring to Google CDN's version of AngularJS, and your user has visited another app which uses AngularJS, then he can avail the benefits of caching, and thus reduce one download, speeding up his overall experience!
Decreased Latency : Google's CDN distributes your static content across the globe, in various diverse, physical locations. It increases the odds that the user gets a version of AngularJS served from a location near him, thus reducing overall latency.
Increased Parallelism : Using Google's CDN reduces one request to your domain. Depending on the browser, the number of parallel requests it can make to a domain is restricted (as low as 2 in IE 7). So it can make a gigantic difference in loading times for users of those browsers.
Angular example:
AngularJS starts automatically when the web page has loaded.
The ng-app directive tells AngularJS that the <div> element is the "owner" of an AngularJS application.
The ng-model directive binds the value of the input field to the application variable name.
The ng-bind directive binds the innerHTML of the <p> element to the application variable name.
Subscribe to:
Posts (Atom)