×

Top 30 AngularJS Interview Questions and Answers for 2024

Most Frequently asked AngularJS Interview Questions and Answers for Fresher

Top 30 Angular-js interview Questions for Fresher and Experienced

1) Describe Angular JS ?

It is a powerful framework of JavaScript. AngularJS is used to design Rich Internet Application. This framework is developed on MVC (Model View Controller) which provide full feature of SPA (Single Page Application) Framework.

2) Give advantages and disadvantages of AngularJS.

Advantages of AngularJS
  1. User can easily create Single page Application
  2. Rich and Responsive experienced to user.
  3. Form Validation is already present.
  4. It is an open source framework.
  5. AngularJS is Platform (Browser) Independent.
  6. It supports Routers and two-way binding.
  7. A code of AngularJS is Unit testable.
Disadvantages of AngularJS
  1. Security: It is not secure as build on JavaScript Framework.
  2. User Dependent: If user disables the JavaScript then AngularJS cannot run.

3) Is jQuery or AngularJS interdependent?

NO, they are not interdependent.

4) Different IDE's that use AngularJS for development?

IDE's are Eclipse, Web Storm, Visual Studio, Text Mate etc.

5) Enlist the Features of AngularJS.

Some AngularJS Features are as Follow:
  1. MVC
  2. Validations
  3. Modules
  4. Directives
  5. Templates
  6. Scope
  7. Expressions
  8. Data Binding
  9. Filters
  10. Services
  11. Routing
  12. Dependency Injection
  13. Testing

6) Define and Enlist Directives of AngularJS.

AngularJS has DOM element Directives which act as Markers. They attach a specific behaviour to that DOM element and can even transform the DOM element and its children. Three main core directives are:
  • ng-app
  • ng-model
  • ng-bind

7) Define Controller in AngularJS?

In AngularJS to provide data and logic into HTML java script function is used which is known as Controller.

8) Give the use of controller.

  • Set up initial state of the $scope object
  • Add behaviour to the $scope object.

9) Define Data Binding in AngularJS?

Data binding is used to synchronize the view and model.

10) How are services used in AngularJS?

Services is a function or object that is used in AngularJS. Some of the inbuilt services are $location, $http etc. There are 30 built in services.

11) Define Scope in AngularJS?

Scope is the binding part between view(HTML) and controller(Java Script) through object. It has some properties and method which is available for both view and controller.

12) How to use template in AngularJS?

Template is used to obtain Dynamic view we uses template which consist of HTML+CSS+AngularJS Directives.

13) Write Expression in AngularJS?

It is similar to JavaScript Expression where it consists of literals, operators, and variables. Eg. {{1+1}} or {{Country+""+State}}.

14) Describe Filter and its use.

Filter is used to transform data it can be embedded in expression or directive. Eg. Currency, Uppercase, Lower case, Order by.

15) What is “$rootScope” in AngularJS?

$rootScopeData provides a seperation between View and its Model. It is the root directory all other scope is its child scope.

16) What is SPA in AngularJS?

SPA stands for Single Page Application which are web application. It loads a single HTML page and dynamically update that page as the user interacts with the app.

17) What is a Factory method in AngularJS?

Factory method is similar to the services. It is used to create new object and add functions as properties of this object and at the end we return this object.

18) What is REST in AngularJS?

REST stands for Representational State Transfer in AngularJS. It operates over HTTP requests over API. The requested URL identifies the data to be operated on, and the HTTP method identifies the operation that is to be performed.

19) What are the attributes can be used during creation of a new AngularJS Directives?

Following are the list of attributes:
  1. Restrict: This attribute consists of value "A" (directives to be triggered on the attribute name), "E" (only match element name), “C” (only match class name) and “M” (only match the comment name).
  2. TemplateUrl: The templateUrl attribute tells the AngularJS HTML compiler to replace custom directive inside a template with HTML content.
  3. Template: It specify an inline template as a string. Not used if you’re specifying your template as a URL.
  4. Replace: It has two values true or false. If true, replace the current element. If false or unspecified, append this directive to the current element.
  5. Transclude: It moves the original children of a directive to a location inside the new template.
  6. Scope: It create a new scope for this directive rather than inheriting the parent scope.
  7. Controller: It create a controller which publishes an API for communicating across directives.
  8. Require: It require that another directive be present for this directive to function correctly.
  9. Link: It modify resulting DOM element instances, add event listeners, and set up data binding.
  10. Compile: It modify the DOM template for features across copies of a directive, as when used in other directives.

20) What are the characterstics of Scope?

Data binding is used to synchronize the view and model.
  1. The $scope is the connection between the HTML and the View.
  2. $scope provides the execution context for the DOM and the expression
  3. $scope is modified when the View changes and the View is modified when $the scope changes its value.
  4. The $rootScope is the parent of all the $scope.
  5. $scope passes data and behavior to the View.

21) What is AngularJS BootStrap Process?

Bootstrap provide cross platform implementation of UI having consistency among internal tools. It is of two types:
  1. Automatic Bootstrap
  2. Manual Bootstrap

22) How would you specify that a scope variable should have one-time binding only?

We can specify the scope by using “::” in front of it. It allows you to check the available variable bindings in AngularJS.

23) Describe angular.copy() method in AngularJS?

angular.copy() method creates a deep copy of the variable. A deep copy of a variable means it doesn’t point to the same memory reference as that variable.

24) What is DDO Directive Definition Object?

DDO is an object used while creating a custome directive.

25) What is an interceptor?

An interceptor is a middleware code where all the $http requests go through. It is registered in $httpProvider. There are 2 types of requests that go through the interceptor, request and response.

27) How to hide HTML element via button click?

It can be done by using directive ng-hide in conjunction with a controller to hide an HTML element on button click.

28) What is injector?

The injector is a service locator. It is used to retrieve object instances as defined by provider, instantiate types, invoke methods and load modules.

29) Explain what is string interpolation in Angular.js ?

Compiler during the compilation process matches text and attributes using interpolate service to see if they contains embedded expressions.

30) How does the digest phase work?

In digest cycle all scope models are compared against their previous values. If changes are detected, the watches set on that model are fired. Then another digest cycle executes, and so on until all models are stable.

Related Topics

Top 28 LISP Interview Questions for 2024

1) What is LISP? LISP is the high-level programming language after Fortran. LISP is stands for List Processing. This programming language was invented by John McCarthy in 1958 at the Massachusetts Institute of...

3 minutes read.

Top 25 DB2 Interview question for 2024

1) Give breif detail about DB2? DB2 is a Relational Database Management System developed by IBM. It supports Object Oriented features and non-relational structures with XML. 2) Enlist the types of datatypes...

3 minutes read.

Top 30 Less Interview Questions for 2024

1) What is Less? Less is a dynamic style sheet language that can be compiled in to CSS (Cascading style Sheet). It runs on client side and server side. It is...

4 minutes read.

Top 15 Java OOPS Interview Questions for 2024

1) What are the advantages of Java Package? Advantages of Java package are: Provides access protection Removes naming collision Easily maintained 2) What are the types of Access Modifiers in Java? Two types...

4 minutes read.

Top 20 Java Programming Coding Interview Questions for 2024

Coding is an integral part of any programming language. It is the most important phase of an interview. Interviewee checks the capability of thinking of any particular. I think one...

13 minutes read.

Top 31 PHP Interview Questions for 2024

1) What is PHP? PHP is a object-oriented scripting language, open source, interpreted and executed at server side. It is also used to develop web applications. 2) What are the features of PHP? Features...

4 minutes read.

Top 15 Java JDBC Interview Questions for 2024

1) What are the types of JDBC Drivers in Java? JDBC Drivers are of four types are: JDBC-ODBC bridge driver Native-API driver Network Protocol driver Thin driver 2) What are the five...

4 minutes read.

Top 30 PyTorch Interview Questions and Answers

Q1: What is PyTorch? Answer: PyTorch is a machine learning library for the programming language Python, based on Torch library, used for application such as natural language processing. It is free...

9 minutes read.

Top 15 PouchDB Interview Questions for 2024

1) What is PouchDB? PouchDB is an in-browser database that allows applications to save data. It is an open source database. It runs in Node.js. 2) In which language PouchDB was written? PouchDB was written in JavaScript language. 3)...

2 minutes read.

Top 15 VBA Interview Questions for 2024

1) What is VBA? VBA stands for Visual Basic Application. It is an event-driven programming language. It is mainly used with Microsoft Office applications such as MS -Excel, MS-Word and MS-Access. 2)...

3 minutes read.

Top 30 VB Script Interview Questions for 2024

1) What is VB Script? VBScript stands for Visual Basic Scripting Language. It is a light version of Microsoft Visual Basic. It is a client side scripting Language. 2) What is the...

5 minutes read.

Top 30 Web Service Interview Questions for 2024

1) What is a Web Service? Web service is a client server application or component. It is used for communication. It is way to communicate between two devices over network. In another word...

5 minutes read.

Top 15 PhantomJS Interview Question for 2024

1) What is PhantomJS? PhantomJS is a lightweight headless scripted browser built on WebKit. It is used for automation web page interaction. 2) Why it is called as headless browser? PhantomJS called as...

4 minutes read.

Top 25 jQuery Interview Questions for 2024

Most Frequently asked jQuery Interview Questions and Answers for Fresher and Experienced 1) Define Find and Children Method? In DOM tree if you have to find all the method we use Find...

4 minutes read.

Top 30 Web2py Framework Interview Questions for 2024

1) What is Web2py Framework? Web2py is an open source web application framework. It is written in the Python programming language. It allows web developers to design and develop dynamic web...

7 minutes read.

Top 14 Material Design Lite Interview Questions for 2024

1) What is Material Design Lite? Material Design Lite is UI component Library. It is created with CSS, JavaScript and HTML. It is used for design purpose. It is developed by...

3 minutes read.

Top 30 Python Interview Questions for 2024

1) What is Python? Python is a high level, interpreted and object-oriented programming language. It is easy to learn and supports multiple programming patterns. It is also known as powerful and versatile...

6 minutes read.

Top 27 JavaScript Interview Questions for 2024

1) Define Undeclared and Undefined Variables? Undeclared variable are defined as these variable is neither defined nor exist in the program. If program calls this variable then it causes Runtime error. Undefined variable...

5 minutes read.

Top 30 FuelPHP Framework Interview Questions for 2024

1) What is FuelPHPFramework? FuelPHP Framework is an open source web application and written in PHP scripting language. It is based on the HMVC (Hierarchical Model View Controller) design pattern. It was released...

6 minutes read.

Top 14 MathML Interview Questions for 2024

1) What is MathML? MathL stands for Mathematical Markup Language. It is extended form of XML. It is used to describe mathematical and scientific notations. 2) Who is the developer of MathML? World...

3 minutes read.