Why AngularJS? This is simple question looks like but many of us doesn’t know the answer. This is the important AngularJS Interview Question that everyone expect on their walkins to AngularJS interview and mostly freshers. This post also gives the answer for features for AngularJS.
There are many obvious reasons for switching over to Angular and some of them are:
- Two-way Data binding
- Extends HTML
- Dependency Injection
- Form Validation
- Deep Linking
- Form Browser Support
Two-Way Data Binding
Your model is where you read or update anything in your application. AngularJS two-way data-binding handles the synchronization between the DOM and the model vice versa.
In AngularJS, a template is just plain old HTML. The HTML templates are parsed by the browser into DOM. The input to AngularJS is browser DOM and not an HTML string like innerHTML.
With Angular, you can operate your HTML like XML, giving you endless possibilities for tags and attributes. Angular accomplishes this via it’s HTML compiler and the use of directives to trigger behaviors based on the newly-created syntax you write.
At the same time you may want to know Things about $broadcast.
Dependency Injection (DI) allows you to ask for your dependencies, rather than having to go look for them or make them yourself. To gain access to core AngularJS services, it is simply a matter of adding that service as parameter. AngularJS will detect that you need that service and provide an instance for you.
- Directives can be used to create custom HTML tags that serve as new, custom widgets
- They can also be used to enhance elements with behavior and manipulate DOM attributes in interesting ways
- We use directives to create reusable components. A component allows you to hide complex DOM Structure, CSS and behavior
An important part of serious apps is localization. Angular’s locale aware filters and directives give you building blocks to make your application available in all locales.
The AngularJS team have designed AngularJS with testability in mind, so that it makes testing your AngularJS applications as easy as possible. AngularJS is written entirely from the ground up to be testable. It even comes with an end-to-end and unit test runner setup.
AngularJS provides the features of deep links providing users access to specific content they need.
Form Browser Support
According to the official website of AngularJS (angularjs.org): They have run their “Extensive test suite against the following browsers: Safari, Chrome, Firefox, Opera, IE8, IE9 and mobile browsers (Android, Chrome mobile, iOS Safari).” There are browser extensions available for Chrome (AngularJS Batarang) for debugging.