What is Angular JS?
AngularJS is an open-source web application framework, maintained by Google and community, that assists with creating single-page applications, which consist of one HTML page with CSS, and JavaScript on the client side. It extends HTML into a more expressive and readable format. It decreases emphasis on directly handling DOM manipulation from the application logic, allowing for easier testing.
It employs efficient two-way data binding and sensible MVC implementation, reducing the server load of applications. It features directives, which are incredibly robust tools that are significant contributors to Angular’s ubiquity.
AngularJS is self-described as ‘HTML enhanced for web apps’.
Things to Know Before Staring with Angular JS
- A very basic knowledge of HTML
- Knowledge of JS and its syntax
- Desire to learn Angular
Why to Use Angular.js?
Nowadays, we have so many JS frameworks, so why choose Angular??
Here we have the answer.
1. MVC
Most frameworks implement MVC by asking you to split your app into MVC components, then require you to write code to string them up together again. That’s a lot of work. Angular implements MVC by asking you to split your app into MVC components, then just lets Angular do the rest.
2. A declarative user interface
Angular uses HTML to define the app’s user interface. HTML is a declarative language which is more intuitive and less convoluted than defining the interface procedurally in JavaScript.
3. Contains Directives
Angular Directives add more functionality to the simple HTML. Directives help to enable the developer to specify custom and reusable HTML tags that change the behavior of some elements.
4. Easy DOM manipulations
AngularJS keeps DOM manipulation codes inside the directives and not in the view. This augments in generating a clean and clear user interface.
5. Test-ready
The fact that AngularJS comes linked with Dependency Injection (DI) makes it ready for unit testing by injecting mock data into controller and measuring the output and behavior.
6. Write less code
All the points up till now mean that you get to write less code.
When Not to Use Angular?
1. Difficult to adapt the existing code
AngularJS requires the developer to re-implement the entire transformation code which makes it extremely hard to play around while adapting existing code.
2. Too heavy
AngularJS is a bulky framework that might be a good option to build large applications. But in case of simpler requirements of data binding, it can get a little too much to deal with and could confuse you with an excess of functionality that might be totally useless. Lighter frameworks like KnockoutJS or BackboneJS might be a better option in such a situation.
Requirement to use Angular JS
Angular.js Local or Angular.js CDN that’s it, right!!
Download any and you are all ready to use Angular.
Conclusion
It’s a complete client-side solution.
Angular is not a single piece in the overall puzzle of building the client-side of a web application. It handles all of the DOM and AJAX glue code you once wrote by hand and puts it in a well-defined structure. This makes Angular opinionated about how a CRUD application should be built. But while it is opinionated, it also tries to make sure that its opinion is just a starting point you can easily change. Angular comes with the following out-of-the-box:
- Data binding, as in {{}}
- DOM control structures for repeating/hiding DOM fragments
- Support for forms and form validation
- Attaching code-behind to DOM elements
- Grouping of HTML into reusable components
Sites Built on Angular
CodeProject