Find Interview Questions for Top Companies
Ques:- What is Global API?
Asked In :- iopex technologies,
Right Answer:
In AngularJS, the Global API refers to the set of built-in services, functions, and objects that are available globally throughout the application, such as `$http`, `$scope`, `$timeout`, and others, which can be used to manage data, handle asynchronous operations, and interact with the DOM.
Comments
Admin May 17, 2020

Global API provides you global functions to perform common JavaScript tasks such as comparing objects, deep copying, iterating through objects, and converting JSON data etc. All global functions can be accessed by using the angular object.

Ques:- What is Angular Prefixes $ and $$?
Asked In :-
Right Answer:
In AngularJS, the prefix `$` is used to denote built-in services, objects, and functions provided by the framework, such as `$http`, `$scope`, and `$timeout`. The prefix `$$` indicates private or internal properties and methods that are not intended for public use, such as `$$watchers` or `$$childHead`.
Comments
Admin May 17, 2020

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.

Ques:- What are Filters in AngularJS?
Asked In :-
Right Answer:
Filters in AngularJS are used to format data displayed to the user. They can transform data in templates, such as formatting dates, currency, or filtering arrays. Filters can be applied using the pipe symbol (|) in expressions.
Comments
Admin May 17, 2020

Filters are used to format data before displaying it to the user. They can be used in view templates, controllers, services and directives. There are some built-in filters provided by AngularJS like as Currency, Date, Number, OrderBy, Lowercase, Uppercase etc. You can also create your own filters.

Ques:- What are Expressions in AngularJS?
Asked In :-
Right Answer:
Expressions in AngularJS are snippets of code that are evaluated by the AngularJS framework to produce a value. They are written in double curly braces `{{ }}` and can include variables, operators, and function calls, allowing dynamic data binding in the HTML.
Comments
Admin May 17, 2020

AngularJS expressions are much like JavaScript expressions, placed inside HTML templates by using double braces such as: {{expression}}. AngularJS evaluates expressions and then dynamically adds the result to a web page. Like JavaScript expressions, they can contain literals, operators, and variables.

Ques:- When dependent modules of a module are loaded?
Asked In :- Xandr,
Right Answer:
Dependent modules of a module are loaded when the module itself is initialized and AngularJS resolves its dependencies during the bootstrap process.
Comments
Admin May 17, 2020

A module might have dependencies on other modules. The dependent modules are loaded by angular before the requiring module is loaded.

Ques:- What is core module in AngularJS?
Asked In :-
Right Answer:
The core module in AngularJS is the "ng" module, which includes the fundamental features and functionalities of AngularJS, such as data binding, dependency injection, and directives.
Comments
Admin May 17, 2020

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.

Ques:- How angular modules load the dependencies?
Asked In :-
Right Answer:
Angular modules load dependencies using the `ngModule` decorator, which defines the module and its dependencies in the `imports` array. These dependencies can include other modules, services, and components that the module requires to function properly.
Comments
Admin May 17, 2020

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.

Ques:- What is difference between config() and run() method in AngularJS?
Right Answer:
In AngularJS, the `config()` method is used to configure the module, such as setting up routes and defining constants or values before the application starts. The `run()` method, on the other hand, is used to execute code after the injector is created and the application is bootstrapped, typically for initializing services or setting up application-wide behaviors.
Comments
Admin May 17, 2020

Configuration block – 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.

Ques:- What are Modules in AngularJS?
Right Answer:
Modules in AngularJS are containers for different parts of an application, such as controllers, services, filters, and directives. They help organize the code, manage dependencies, and enable the separation of concerns within the application. Each AngularJS application has at least one module, which is defined using the `angular.module()` function.
Comments
Admin May 17, 2020

Modules are used to seperate logics say services, controllers, application etc. We define modules in seperate js files & name them appropriately

Ques:- What components can be defined within AngularJS modules?
Asked In :-
Right Answer:
In AngularJS, the components that can be defined within modules include controllers, services, directives, filters, and constants.
Comments
Admin May 17, 2020

The following components can be defined using AngularJS modules:
1. Directives
2. Filters
3. Controller
4. Factory
5. Service
6. Provider
7. Value
8. Config Settings and Routes

Ques:- How AngularJS handle the security?
Asked In :- tringapps,
Right Answer:
AngularJS handles security primarily through two mechanisms:

1. **Sanitization**: It automatically sanitizes user inputs to prevent XSS (Cross-Site Scripting) attacks by stripping out unsafe HTML and JavaScript.

2. **Content Security Policy (CSP)**: AngularJS encourages the use of CSP to restrict the sources from which scripts can be loaded, further enhancing security against code injection attacks.

Additionally, it uses strict contextual escaping (SCE) to ensure that data binding is safe and that potentially dangerous content is not executed.
Comments
Admin May 17, 2020

AngularJS provide following built-in protection from basic security holes:
1. Prevent HTML injection attacks.
2. Prevent Cross-Site-Scripting (CSS) attacks.
3. Prevent XSRF protection for server side communication.

Ques:- What is ngClass directive in AngularJS?
Asked In :-
Right Answer:
The `ngClass` directive in AngularJS is used to dynamically add or remove CSS classes on an HTML element based on the evaluation of an expression. It allows you to bind class names to the scope variables or expressions, enabling conditional styling.
Ques:- How looping has been done in AngularJS?
Asked In :-
Right Answer:
Looping in AngularJS is done using the `ng-repeat` directive, which allows you to iterate over a collection (like an array or an object) and generate HTML for each item in the collection.
Ques:- What is the difference between Rootscope and Scope in AngularJS?
Right Answer:
In AngularJS, `$rootScope` is the parent of all `$scope` objects and is available throughout the application, while `$scope` is specific to a controller or directive and is used to bind data between the controller and the view. Changes in `$rootScope` can be accessed by all child scopes, but changes in a child `$scope` do not affect the `$rootScope`.
Ques:- Can AngularJS have multiple ng-app directives in a single page?
Asked In :-
Right Answer:
No, AngularJS should only have one ng-app directive per page.
Ques:- How AngularJS will automatically be initialized?
Asked In :-
Right Answer:
AngularJS is automatically initialized when the browser loads the application. It looks for the `ng-app` directive in the HTML, which indicates the root element of the AngularJS application. Once found, AngularJS bootstraps the application by compiling the HTML and linking it with the associated controllers and services.
Ques:- Explain how we can create module and using it in AngularJS?
Asked In :-
Right Answer:
In AngularJS, you can create a module using the `angular.module` method. Here’s how to do it:

1. Create a module:
```javascript
var myApp = angular.module('myApp', []);
```

2. Use the module in your application by including it in the `ng-app` directive in your HTML:
```html
<div ng-app="myApp">
<!-- Your application code here -->
</div>
```

3. You can also define controllers, services, and other components within the module:
```javascript
myApp.controller('MyController', function($scope) {
$scope.message = "Hello, AngularJS!";
});
```

4. Use the controller in your HTML:
```html
<div ng-controller="MyController">
{{ message }}
</div>
```
Ques:- In case of nested controllers, does the $scope object shared across all controllers?
Asked In :-
Right Answer:
No, the `$scope` object is not shared across all controllers in nested controllers. Each controller has its own `$scope`, but the child controller's `$scope` inherits from the parent controller's `$scope`.
Ques:- What is SPA (Single Page Application) in AngularJS?
Right Answer:
A Single Page Application (SPA) in AngularJS is a web application that loads a single HTML page and dynamically updates the content as the user interacts with the app, without requiring a full page reload. This allows for a smoother user experience and faster navigation.
Ques:- Is AngularJS is compatible with all modern browsers?
Asked In :- tringapps, Orion Innovation,
Right Answer:
Yes, AngularJS is compatible with all modern browsers, including Chrome, Firefox, Safari, and Edge.


The AngularJS category on takluu.com is crafted for frontend developers and aspirants preparing for interviews involving the AngularJS framework. AngularJS, developed by Google, is a popular JavaScript-based open-source framework that helps build dynamic single-page applications (SPAs) with ease.

This section covers essential AngularJS topics such as two-way data binding, directives, controllers, scopes, services, dependency injection, and routing. It also dives into the framework’s architecture and how it simplifies complex frontend development tasks.

Interview questions often focus on practical usage and understanding of AngularJS features, including:

  • “What are directives and how are they used?”

  • “Explain the concept of two-way data binding.”

  • “How does dependency injection work in AngularJS?”

Our content includes clear explanations, code snippets, and real-world examples to help you grasp AngularJS concepts effectively. Whether you’re a beginner or an experienced developer, this category prepares you for both basic and advanced technical questions.

At Takluu, we keep this category updated with best practices and the latest trends in AngularJS development to ensure you’re ready to excel in your interviews and projects.

AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users