AngularJS is a JavaScript framework for developing a client-side Web applications. It first version 1.0 was released in 2012 and nowadays it is most used JavaScript Framework because of the good approach of the development and code organization. We can not underestimate the influence of Angular js which is making it a successful framework created by Google.
In this article, we will explore the fundamental characteristics of AngularJS and the proposed approach for Web applications development, analyze the default components but using the infrastructure of the Angular JS
What AngularJS
AngularJS is a framework, an infrastructure for the creation of applications composed of a set of features.
Definition from the official site:
Angular is what HTML would have been, had it been designed for applications.
AngularJS is a useful for building a modular architecture and testable application logic for application development.Angular JS enhances the declarative approach of HTML GUI.
Angular JS is used to develop structural framework modern applications which support the latest applications such as Single Page Application. Single Page Application is application where resources are loaded dynamically on request without having to reload the entire page and updating the DOM.The most wonderful part of Angular JS is it provides automated bidirectional data binding. Data binding can help you avoid a lot of initialization code and save development time.
Features:
Here are the main features supported by Angular JS:
- Support the pattern MVC
- Module support
- Two-way data binding.
- Testability code.
- Reusable components
- Dependency Injection
I know at this starting level difficult to understand the features.we will expand each feature in series articles at great length.
AngularJS is not a library like jQuery or underscore.js but a framework for the development of JavaScript applications.JQuery and other libraries are traditional whereas angular js is more focused on what we want (what) and more suited to building CRUD application.
Angular JS is using Curly brackets {{}} syntax for data binding.
The AngularJS framework is mainly divided into the following three major parts:
- ng-app:
This directive defines and links an AngularJS application to HTML.“ng-app” directive tells AngularJs to look at this document for other angular directives.
ng-app directive marks the scope for AngularJS script. For example, if you add ng-app attribute in <html> tag.it means the whole <html> are in AngularJS script scope. Developers can also use ng-app commands locally, such as in <div ng-app>, then AngularJS script runs only for the <div> tag.
- ng-model:
This directive binds the values of AngularJS application data to HTML input controls (input, select, text area).
- ng-bind:
This directive binds the AngularJS application data to HTML tags and views.
AngularJS File:
AngularJS is a JavaScript framework. It is a library written in JavaScript. Within the script tag use an Angular js reference file.
1 2 3 | <script src="lib/angular.min.js"></script> |
This line of code is used to load angular.js script, when the browser is finished loading the entire HTML page angular.js script will be executed, the script runs will look after angular.js HTML tags contain ng-app instructions, the label defines the scope of AngularJS applications.
This aspect has advantages, since generally a framework has numerous features already ready to use, but can have some drawbacks since “forces” to work in a specific way. It is important to keep this in mind in assessing whether Angular is the right tool for a given project or not.