1. What is AngularJS?
AngularJS is a framework to build large scale and high performance web application while keeping them as easy-to-maintain. Following are the features of AngularJS framework.
- AngularJS is open source, completely free, and used by thousands of developers around the world. It is licensed under the Apache License version 2.0.
2. Why to use AngularJS?
There are following reasons to choose AngularJS as a web development framework:
- It is based on MVC pattern which helps you to organize your web apps or web application properly.
- It extends HTML by attaching directives to your HTML markup with new attributes or tags and expressions in order to define very powerful templates.
- It also allows you to create your own directives, making reusable components that fill your needs and abstract your DOM manipulation logic.
- It encapsulates the behaviour of your application in controllers which are instantiated with the help of dependency injection.
- It supports services that can be injected into your controllers to use some utility code to fulfil your need. For example, it provides $http service to communicate with REST service.
- It supports dependency injection which helps you to test your angular app code very easily.
- Also, AngularJS is mature community to help you. It has widely support over the internet.
3. Why this project is called "AngularJS"?
Html has angle brackets i.e. <,> and ng sound like Angular. That’s why it is called AngularJS.
4. What are the advantages of AngularJS?
There are following advantages of AngularJS:
- Data Binding - AngularJS provides a powerful data binding mechanism to bind data to HTML elements by using scope.
- Customize & Extensible - AngularJS is customized and extensible as per you requirement. You can create your own custom components like directives, services etc.
- Code Reusability - AngularJS allows you to write code which can be reused. For example custom directive which you can reuse.
- Support – AngularJS is mature community to help you. It has widely support over the internet. Also, AngularJS is supported by Google which gives it an advantage.
- Testing - AngularJS is designed to be testable so that you can test your AngularJS app components as easy as possible. It has dependency injection at its core, which makes it easy to test.
- AngularJS mark-up lives in the DOM.
- AngularJS is leverages with Dependency Injection.
6. What IDEs you can use for AngularJS development?
AngularJS development can be done with the help of following IDEs:
- Visual Studio 2012, 2013, 2015 or higher
- Sublime Text
7. Does AngularJS has dependency on jQuery?
AngularJS has no dependency on jQuery library. But it can be used with jQuery library.
8. How to use jQuery with AngularJS?
By default AngularJS use jQLite which is the subset of jQuery. If you want to use jQuery then simply load the jQuery library before loading the AngularJS. By doing so, Angular will skip jQLite and will started to use jQuery library.
9. Is AngularJS a library, framework, plugin or a browser extension?
10. What browsers AngularJS support?
The latest version of AngularJS 1.3 support Safari, Chrome, Firefox, Opera 15+, IE9+ and mobile browsers (Android, Chrome Mobile, iOS Safari, Opera Mobile).
AngularJS 1.3 has dropped support for IE8 but AngularJS 1.2 will continue to support IE8.
11. What is the size of angular.js file?
The size of the compressed and minified file is < 36KB.
12. What are AngularJS features?
- Data Binding
- MVC (Model, View & Controller)
- Dependency Injection
13. How AngularJS handle the security?
AngularJS provide following built-in protection from basic security holes:
- Prevent HTML injection attacks
- Prevent Cross-Site-Scripting (CSS) attacks
- Prevent XSRF protection for server side communication
Also, AngularJS is designed to be compatible with other security measures like Content Security Policy (CSP), HTTPS (SSL/TLS) and server-side authentication and authorization that greatly reduce the possible attacks.
14. What are Modules in AngularJS?
AngularJS modules are containers just like namespace in C#. They divide an angular app into small, reusable and functional components which can be integrated with other angular app. Each module is identified by a unique name and can be dependent on other modules. In AngularJS, every web page (view) can have a single module assigned to it via ng-app directive.
15. What components can be defined within AngularJS modules?
- Config settings and Routes
16. What is core module in AngularJS?
ng is the core module in angular. This module is loaded by default when an angular app is started. This module provides the essential components for your angular app like directives, services/factories, filters, global APIs and testing components.
17. How angular modules load the dependencies?
An angular module use configuration and run blocks to inject dependencies (like providers, services and constants) which get applied to the angular app during the bootstrap process.
18. What is difference between config() and run() method in AngularJS?
This block is executed during the provider registration and configuration phase. Only providers and constants can be injected into configuration blocks. This block is used to inject module wise configuration settings to prevent accidental instantiation of services before they have been fully configured. This block is created using config() method.
Run block –
This block is executed after the configuration block. It is used to inject instances and constants. This block is created using run() method. This method is like as main method in C or C++.
The run block is a great place to put event handlers that need to be executed at the root level for the application. For example, authentication handlers.
19. When dependent modules of a module are loaded?
A module might have dependencies on other modules. The dependent modules are loaded by angular before the requiring module is loaded.
In other words the configuration blocks of the dependent modules execute before the configuration blocks of the requiring module. The same is true for the run blocks. Each module can only be loaded once, even if multiple other modules require it.
20. What is Angular Prefixes $ and $$?
To prevent accidental name collisions with your code, Angular prefixes names of public objects with $ and names of private objects with $$. So, do not use the $ or $$ prefix in your code.