Top 30 Angular JS MCQ Questions and Answers with Explanation and Exercise

By HH Team | Views: 5117

 

Q1 - What is deep linking in AngularJS?

A - Deep linking allows you to encode the state of the application in the URL so that it can be bookmarked.
B - Deep linking is an SEO-based technique.
C - Deep linking refers to linking various views to a central page.
D - None of the above.

Answer: A
Explanation
Deep linking allows you to encode the state of the application in the URL so that it can be bookmarked. The application can then be restored from the URL to the same state.

Q 2 - Which of the following is not a core AngularJS directive.

A - ng-app
B - ng-model
C - ng-bind
D - ng-state

Answer : D
Explanation
ng-state is not an AngularJS directive.

Q 3 - AngularJS application expressions are pure JavaScript expressions.

A - true
B - false

Answer: A
Explanation
AngularJS application expressions are pure JavaScript expressions.

Q 4 - Which of the following is true about the currency filters?

A - Currency filter formats text in a currency format.
B - Currency filter is a function that takes text as input.
C - Both of the above.
D - None of the above.

Answer: B
Explanation
Currency filter formats text in a currency format. It is simply added to AngularJS expression to filter out the result.

Q 5 - Model available in $rootScope can be overridden by its all child scopes.

A - true
B - false

Answer: A
Explanation
Model available in $rootScope can be overridden by its all child scopes.

Q 6 - Which components can be injected as a dependency in AngularJS?

A - value
B - factory
C - service
D - All of the above.

Answer : D
Explanation
All of the above can be injected as a dependency.

Q 7 - constants are used to pass values at the config phase.

A - true
B - false

Answer: A
Explanation
constants are used to pass values at the config phase because the value cannot be used to be passed during the config phase.

Q 8 - AngularJS applications can run on all major browsers and smartphones including Android and iOS-based phones/tablets.

A - true
B - false

Answer: A
Explanation
AngularJS applications can run on all major browsers and smartphones including Android and iOS-based phones/tablets.

Q 9 - lowercase filter is applied to an expression using a pipe character.

A - false
B - true

Answer: B
Explanation
the lowercase filter is applied to an expression using pipe character.

Q 10 - AngularJS bootstraps itself during the config phase.

A - true
B - false

Answer: A
Explanation
AngularJS bootstraps itself during the config phase.

Q 11- What is a Model in MVC?

A - Model represents server-side data.
B - Model represents data stored in a database.
C - Model is the lowest level of the pattern responsible for maintaining data.
D - None of the above.

Answer: C
Explanation
Model is the lowest level of the pattern responsible for maintaining data.

Q 12- Use novalidate with a form declaration to disable any browser specific validation.

A - true
B - false

Answer: A
Explanation
Use novalidate with a form declaration to disable any browser-specific validation.

Q13 - Is AngularJS open source?

A - true
B - false

Answer: A
Explanation
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.

Q14 - $rootScope is the parent of all of the scope variables.

A - true
B - false

Answer: A
Explanation
$rootScope is the parent of all of the scope variables.

Q15 - Services are singleton objects which are instantiated only once in-app.

A - false
B - true

Answer: B
Explanation
Services are singleton objects which are instantiated only once in-app.

Q16 - What is data binding in AngularJS?

A - Data binding is the technique to save HTML data in the database.
B - Data binding is the technique to bind database data to HTML control.
C - Data binding is the automatic synchronization of data between model and view components.
D - Data binding is the automatic synchronization of data between model and controller components.

Answer: C
Explanation
Data binding is the automatic synchronization of data between model and view components.

Q17 - How angular.module works?

A - angular.module is used to create AngularJS modules along with its dependent modules.
B - angular.module is primarily used to create application modules.
C - Both of the above.
D - None of the above.

Answer: C
Explanation
the angular.module is used to create AngularJS modules along with its dependent modules. It is primarily used to create an application module.

Q18 - Which of the following is true about filter filters?

A - filter filter is a function that takes text as input.
B - filter filter is used to filter the array to a subset of it based on provided criteria.
C - Both of the above.
D - None of the above.

Answer: B
Explanation
filter filter is used to filter the array to a subset of it based on provided criteria. It is simply added to AngularJS expression to filter out the result.

Q19 - With AngularJS, the developer writes less code and gets more functionality.

A - false
B - true

Answer: B
Explanation
With AngularJS, a developer writes less code and gets more functionality.

Q20 - On which of the following types of components can we create a custom directive?

A - Element directives
B - Attribute
C - CSS
D - All of the above.

Answer : D
Explanation
AngularJS provides support to create custom directives for the following types of elements.
Element directives - Directive activates when a matching element is encountered.
Attribute - Directive activates when a matching attribute is encountered.
CSS - Directive activates when a matching css style is encountered.
Comment - Directive activates when a matching comment is encountered.

Q21 - What MVC stands for?

A - Model View Control
B - Model View Controller
C - Main View Controller
D - Main View Control

Answer: B
Explanation
MVC stands for Model View Controller.

Q22 - Which of the following is true about AngularJS expressions?

A - Expressions are used to bind application data to HTML.
B - Expressions are written inside double braces like {{ expression}}.
C - Expressions behave in the same way as ng-bind directives. 
D - All of the above.

Answer : D
Explanation
Expressions are used to bind application data to HTML. Expressions are written inside double braces like {{ expression}}. Expressions behave in the same way as ng-bind directives. AngularJS application expressions are pure JavaScript expressions and output the data where they are used.

Q23 - $http service is used to make an Ajax call to the server.

A - false
B - true

Answer: B
Explanation
AngularJS provides $http control which works as a service to make ajax calls to read data from the server.

Q24 - We need to incorporate corresponding js according to the locale of the country to support Internationalization in AngularJS based applications.

A - true
B - false

Answer: A
Explanation
AngularJS supports inbuilt internationalization for three types of filters currency, date, and numbers. We only need to incorporate corresponding js according to the locale of the country. By default, it handles the locale of the browser. For example, to use Danish locale, use the following script

<script src="https://code.angularjs.org/1.2.5/i18n/angular-locale_da-dk.js"></script> 

Q25 - Inbuilt services are always prefixed with the $ symbol.

A - true
B - false

Answer: A
Explanation
Inbuilt services are always prefixed with the $ symbol.

Q26 - currency filter is applied to an expression using pipe character.

A - true
B - false

Answer: A
Explanation
currency filter is applied to an expression using pipe character.

 

EXERCISE

 

Q 1 - Which of the following is true about AngularJS?

A - AngularJS is a framework to build large-scale and high-performance web applications while keeping them as easy-to-maintain.
B - AngularJS provides developers options to write a client-side application (using JavaScript) in a clean MVC (Model View Controller) way.
C - AngularJS is a powerful JavaScript-based development framework to create RICH Internet Application(RIA).
D - All of the above

Q 2 - Is AngularJS open source?

A - true
B - false

Q 3 - Are applications written using AngularJS cross-browser compliant?

A - true
B - false

Q 4 - What is data binding in AngularJS?

A - Data binding is the technique to save HTML data in the database.
B - Data binding is the technique to bind database data to HTML control.
C - Data binding is the automatic synchronization of data between model and view components.
D - Data binding is the automatic synchronization of data between model and controller components.

Q 5 - Which directive is used for data binding in AngularJS?

A - ng-data
B - ng-app
C - ng-bind
D - ng-controller

Q 6 - What happens when the page containing AngularJS based Application loads.

A - HTML document is loaded into the browser, and evaluated by the browser.
B - AngularJS JavaScript file is loaded; the angular global object is created.
C - JavaScript which registers controller functions is executed.
D - All of the above.

Q 7 - What are scopes in AngularJS?

A - Scopes define the accessibility of a javascript variable.
B - Scopes are objects that refer to the model. They act as the glue between controller and view.
C - Scopes are objects that refer to the controller.
D - Scopes are objects that refer to the views.

Q 8 - What are the controllers in AngularJS?

A - Controllers are JavaScript functions that are bound to a particular scope.
B - Controller carries functions to operate on data and decide which view is to be updated to show the updated model-based data.
C - They are the prime actors in the AngularJS framework.
D - All of the above.

Q 9 - What are the services in AngularJS?

A - Services are singleton objects which are instantiated only once in-app and are used to do the defined task.
B - Services are objects which AngularJS uses internally.
C - Services are not used in AngularJS.
D - Services are server-side components of AngularJS.

Q 10 - What are the filters in AngularJS?

A - Filters select a subset of items from an array and return a new array.
B - Filters are used to show filtered items from a list of items based on defined criteria.
C - Both of the above.
D - None of the above.

Q 11 - What is deep linking in AngularJS?

A - Deep linking allows you to encode the state of the application in the URL so that it can be bookmarked.
B - Deep linking is an SEO-based technique.
C - Deep linking refers to linking various views to a central page.
D - None of the above.

Q 12 - Is AngularJS code unit testable?

A - false
B - true

Q 13 - Do AngularJS provide reusable components?

A - false
B - true

Q 14 - Which of the following is not a core AngularJS directive.

A - ng-app
B - ng-model
C - ng-bind
D - ng-state

Q 15 - Which of the following is true about the ng-app directive?

A - ng-app directive defines and links an AngularJS application to HTML.
B - ng-app directive indicates the start of the application.
C - Both of the above.
D - None of the above.

Q 16 - Which of the following is true about the ng-model directive?

A - ng-model directive binds the values of AngularJS application data to HTML input controls.
B - ng-model directive creates a model variable that can be used with the Html page and within the container control having ng-app directive.
C - Both of the above.
D - None of the above.

Q 17 - Which of the following is true about the ng-bind directive?

A - ng-bind directive binds the AngularJS Application data to HTML tags.
B - ng-bind updates the model created by the ng-model directive to be displayed in the HTML tag.
C - ng-bind updates HTML control data when the controller changes the model.
D - All of the above.

Q 18 - Which of the following is true about the ng-controller directive?

A - ng-controller directive tells AngularJS what controller to use with this view.
B - AngularJS application mainly relies on controllers to control the flow of data in the application.
C - A controller is a JavaScript object containing attributes/properties and functions.
D - All of the above.

Q 19 - Which of the following is true about the ng-init directive?

A - ng-init directive initializes AngularJS Application data.
B - ng-init directive is used to put values to the variables to be used in the application.
C - Both of the above.
D - None of the above.

Q 20 - Which of the following is true about AngularJS expressions?

A - Expressions are used to bind application data to HTML.
B - Expressions are written inside double braces like {{ expression}}.
C - Expressions behave in the same way as ng-bind directives.
D - All of the above.

Q 21 - What MVC stands for?

A - Model View Control
B - Model View Controller
C - Main View Controller
D - Main View Control

Q 22 - What is MVC?

A - MVC is the name of an algorithm.
B - MVC is a software design pattern for developing web applications.
C - MVC is a software technique to optimize web application performance.
D -None of the above.

Q 23 - What is a Model in MVC?

A - Model represents server-side data.
B - Model represents data stored in a database.
C - Model is the lowest level of the pattern responsible for maintaining data.
D - None of the above.

Q 24 - What is View in MVC?

A - View represents a database view.
B - View is responsible for displaying all or a portion of the data to the user.
C - View is responsible to act and process the data.
D - None of the above.

Q 25 - What is the controller in MVC?

A - It is a software Code that stores the data.
B - It is a software Code that renders the user interface.
C - It is a software Code that controls the interactions between the Model and View.
D - None of the above.

 

Question No.Answers
1.D
2.A
3.A
4.C
5.C
6.D
7.B
8.D
9.A
10.C
11.A
12.B
13.B
14.D
15.C
16.C
17.D
18.D
19.C
20.D
21.B
22.B
23.C
24.B
25.C

 

Also Read:

Commonly Asked AngularJS Interview Questions and Answers for Experienced and Freshers

Practice our complete set of quantitative and English

Thank you for your feedback!