139
83k

160+ Angular-JS Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Business Administration in Computer Applications (BBA [CA]) .

Chapters

Chapter: AngularJS Core Concepts
1.

AngularJS is a library?

A. True
B. False
C. none
D. all
Answer» B. False
2.

Who is sometimes called as Father of AngularJS?

A. Brad Green
B. Igor Minor
C. Misko Hevery
D. Brian Ford
Answer» C. Misko Hevery
3.

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

A. ng-init directive initializes an 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.
Answer» C. Both of the above.
4.

Which of the following directive is used to initialize an angular app?

A. ng-model
B. ng-app
C. ng-controller
D. None of the above
Answer» B. ng-app
5.

ng-app directive defines and links an AngularJS application to HTML.

A. false
B. true
C. none
D. all
Answer» B. true
6.

AngularJS supports two-way data binding?

A. True
B. False
C. none
D. all
Answer» A. True
7.

AngularJS expressions are written using.

A. double braces like {{ expression}}
B. single braces like {expression}
C. small bracket like (expression)
D. capital bracket like [expression]
Answer» A. double braces like {{ expression}}
8.

AngularJS is an MVC based framework?

A. True
B. False
C. none
D. all
Answer» A. True
9.

AngularJS bootstraps itself during config phase.

A. true
B. false
C. none
D. all
Answer» A. true
10.

Angular initializes based upon which of the following scenario?

A. DOMContentLoaded event happens
B. document.readyState is set to complete
C. Both of the above
D. None of the above
Answer» C. Both of the above
11.

An Angular application can be initialized on ______?

A. Only HTML element
B. ANY element
C. none
D. all
Answer» B. ANY element
12.

Can an HTML page have multiple “ng-app” directive for bootstrapping multiple AngularJS application?

A. Yes
B. No
C. none
D. all
Answer» B. No
13.

With more than one ng-app in an HTML document (an HTML page), are all of them automatically initialized?

A. Yes
B. No
C. No, only one app is automatically initialized. Others have to manually initialized.
D. none of the above
Answer» C. No, only one app is automatically initialized. Others have to manually initialized.
14.

Can angular applications (ng-app) be nested within each other?

A. Yes
B. No
C. none
D. all
Answer» B. No
15.

What are various possible prefixes such as 'ng-' using which Angular directives (for example, ng-app) can be defined?

A. 'ng-', 'data-ng-', 'ng:'
B. 'ng-'
C. 'ng-', 'data-ng-', 'ng:', 'x-ng-'
D. 'ng-', 'data-ng-','x-ng-'
Answer» C. 'ng-', 'data-ng-', 'ng:', 'x-ng-'
16.

What are various possible ways in which angular application can be initialized?

A. On an element, one could either put simply the attribute such as (ng-app, data-ng-app, ng:app, x-ng-app)
B. Put the named attribute such as (ng-app='demoApp')
C. Both of the above
D. none
Answer» C. Both of the above
17.

filter filter is applied to an expression using pipe character.

A. true
B. false
C. none
D. all
Answer» A. true
18.

What angular function is used to manually start up an angular application?

A. angular.bootstrap
B. angular.element
C. angular.copy
D. None of the above
Answer» A. angular.bootstrap
19.

Which components can be injected as a dependency in AngularJS?

A. Application Module
B. constant
C. value
D. factory
Answer» A. Application Module
20.

Can multiple angular applications be bootstrapped using same element??

A. Yes
B. No. An error is thrown such as 'App Already Bootstrapped with this Element'
C. none
D. all
Answer» B. No. An error is thrown such as 'App Already Bootstrapped with this Element'
21.

At framework level, how does Angular retrieve the matching elements for processing?

A. Makes use of jqLite(element) function.
B. If jQuery is used, jQuery(element) is used by way of assigning jQuery to jqLite variable
C. Both of the above
D. None of the above
Answer» C. Both of the above
22.

Directives can be applied to which all element type?

A. Element
B. Attribute
C. Comment
D. All of the above
Answer» D. All of the above
23.

angular.module is primarily used to create application module.

A. true
B. false
C. none
D. all
Answer» A. true
24.

Which API need to be invoked on the rootScope service to get the child scopes?

A. new
B. $new
C. none
D. all
Answer» B. $new
25.

Which angular module is loaded by default?

A. ng
B. ng-app
C. none
D. all
Answer» A. ng
26.

Which angular function is used to wrap a raw DOM element or HTML string as a jQuery element?

A. angular.element
B. angular.bootstrap
C. none
D. all
Answer» A. angular.element
27.

Can '$scope' be injected while creating service using 'factory' method?

A. Yes
B. No
C. none
D. all
Answer» B. No
28.

AngularJS needs data in JSON format to populate its model.

A. true
B. false
C. none
D. all
Answer» A. true
29.

Scope act as glue between controller and view.

A. true
B. false
C. none
D. all
Answer» A. true
30.

AngularJS 1.0 was released in 2013.

A. True
B. False
C. none
D. all
Answer» B. False
31.

AngularJS is based on the . . . . . . pattern.

A. VMC
B. MVC
C. MCV
D. CVM
Answer» B. MVC
32.

AngularJS applications are a mix of . . . . . .

A. HTML and PHP
B. HTML and CrossScript
C. HTML and AngularScript
D. HTML and JavaScript
Answer» D. HTML and JavaScript
33.

We need to tell AngularJS what part of our HTML page contains the AngularJS app. You do so by adding the . . . . attribute to the root HTML element of the AngularJS app.

A. ng-app
B. ag-app
C. js-app
D. aj-app
Answer» A. ng-app
34.

There is a controller which takes single parameter. We call it . . . . . parameter.

A. $param
B. $control
C. $scope
D. $scont
Answer» C. $scope
35.

The . . . . . . directive is one of the most fundamental directives in AngujarJS. The . . . . . directive inserts the result of an expression into the HTML template.

A. Debug
B. Interpolation
C. Matching
D. Controller
Answer» D. Controller
36.

First the HTML document is loaded into the browser, and evaluated by the browser. At this time the AngularJS . . . . . . .

A. JavaScript file is loaded,
B. the angular global object is created,
C. your JavaScript which registers controller functions is executed,
D. all of above
Answer» D. all of above
37.

You cannot use AngularJS directives to tell AnguluarJS how to mix the data into the HTML template.

A. True
B. False
C. none
D. all
Answer» B. False
38.

If the data obtained from the model contains HTML elements, these are escaped before being inserted into the HTML template. The escaping means that the HTML is displayed as text, and not as HTML. This is done to prevent . . . .

A. SQL injection attacks
B. JS injection attacks
C. HTML injection attacks
D. Python injection attacks
Answer» C. HTML injection attacks
39.

AngularJS can show or hide HTML depending on the state of data in the model. You do so using a set of AngularJS directives such as . . . . . . which are created specifically for that purpose.

A. ng-shown, ng-hidden
B. ng-show, ng-hide
C. nt-show, nt-hide
D. ng-shows, ng-hides
Answer» B. ng-show, ng-hide
40.

The . . . . . directive is used if you want to add or remove HTML elements from the DOM based on data in the model.

A. ng-switch
B. ng-model
C. ng-Disabled
D. ng-Cloak
Answer» A. ng-switch
41.

Event binding can be defined . . . . . . . . .

A. by wrapping the event in (parenthesis)
B. by prefixing it with in
C. by wrapping the event in {curly brackets}
D. by prefixing it with on
Answer» A. by wrapping the event in (parenthesis)
42.

EventEmitter class acts both as an observer and observable.

A. True
B. False
C. none
D. all
Answer» A. True
43.

Events in Angular 2 behave like normal DOM events. They can bubble up but cannot propagate down.

A. True
B. False
C. none
D. all
Answer» B. False
44.

EventEmitter class’s simple interface, which basically encompass two methods . . . . . . . . . can therefore be used to trigger custom events and listen to events as well, both synchronously or asynchronously.

A. exit()
B. superscript()
C. subscribe()
D. emit()
Answer» C. subscribe()
45.

Angular framework provides event binding using in-built event as well as custom event. Custom events are the EventEmitter instances. To create a custom event we need to create an instance of EventEmitter annotated by . . . . . . .

A. @Input()
B. @Get()
C. @Output()
D. @Set()
Answer» A. @Input()
46.

EventEmitter class is used by directives and components to emit custom Events.

A. True
B. False
C. none
D. all
Answer» A. True
47.

@Output() myEvent = new EventEmitter();

A. Declares an output property that fires events that you cannot subscribe to with an event binding.
B. Declares an output property that fires events that you can subscribe to with an event binding.
C. Declares an output property that overrides events that you can subscribe to with an event binding.
D. Declares an output property that subscribes events that you can subscribe to with an event binding.
Answer» D. Declares an output property that subscribes events that you can subscribe to with an event binding.
48.

. . . . . . . . need to be passed as a parameter in the event callback from the template to capture the event object.

A. $event.start
B. $events
C. $eventobj
D. $event
Answer» D. $event
49.

Calling . . . . . . . . on the event prevents propagation.

A. stopEventPropagation
B. preventEventPropagation
C. stopPropagation
D. preventPropagation
Answer» C. stopPropagation
50.

Events on child elements are propagated upwards, and hence event binding is also possible on a parent element.

A. True
B. False
C. none
D. all
Answer» A. True

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.