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
Chapter: AngularJS Directives and Expressions
51.

Angular 2 is a cross platform framework.

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

Angular 2 is entirely component based. Controllers and $scope are no longer used. They have been replaced by . . . . . . . and . . . . . . . .

A. components, controllers
B. $scopes, components
C. components, directives
D. controllers, directives
Answer» C. components, directives
53.

Angular 2 still does not provide nested components.

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

Angular 2 components can be described using . . . . . . A . . . . . . is a way to do some meta-programming.

A. controllers, controller
B. loaders, loader
C. typescripts, typescript
D. decorators, decorator
Answer» D. decorators, decorator
55.

Angular 2 uses . . . . . . . . syntax for built-in directives.

A. Pascal case
B. Snake case
C. Camel case
D. Underscore case
Answer» C. Camel case
56.

You can use languages like . . . . . . . . . to write Angular 2 code.

A. ES5
B. ES6
C. TypeScriptor
D. Dart
Answer» A. ES5
57.

The . . . . . . . . . . directive substitutes the normal href property and makes it easier to work with route links in Angular 2.

A. RouterLink
B. RouterRend
C. RouterLike
D. RouterLayer
Answer» A. RouterLink
58.

There are two ways to build forms in Angular 2, namely . . . . and . . . . . .

A. interface-driven
B. model-driven
C. template-driven
D. modular-driven
Answer» B. model-driven
59.

Angular 2 is an open source JavaScript framework to build web applications in HTML and JavaScript and has been conceived as a . . . . . . . . .

A. mobile first approach
B. UI first approach
C. web first approach
D. all of above
Answer» A. mobile first approach
60.

Angular 1 core concept was $scope, and you will not find $scope in angular 2.0. Angular 2 is using . . . . . . . . to detect changes.

A. zone$.js
B. Scope.js
C. zone.js
D. zones.js
Answer» C. zone.js
61.

Angular 2 integrates easily with NativeScript, allowing you to code your native app in a . . . . . . . . . style that can run on any mobile device platform.

A. declarative
B. imperative
C. interrogative
D. exclamatory
Answer» A. declarative
62.

Angular 2 make use of the . . . . . . . module syntax.

A. ES2016a
B. ES2017
C. ES2016
D. ES2015
Answer» D. ES2015
63.

In Angular 2, applications rely upon the . . . . . . . method to load top-level components

A. loadstrap
B. bootstrap
C. bootload
D. none of above
Answer» B. bootstrap
64.

In Angular 2.0, the template compilation process is . . . . . . .

A. synchronous
B. asynchronous
C. none
D. all
Answer» B. asynchronous
65.

On the opposite side of event bindings (()) lie Angular's square-bracket syntax ([]) which signify a . . . . . .

A. property binding
B. class binding
C. style binding
D. both A & B
Answer» A. property binding
66.

Angular 2.0 contains a logging service called . . . . . which is very useful feature measuring where time is spent in your application.

A. config.js
B. logging.js
C. diary.js
D. none of above
Answer» C. diary.js
67.

The router in Angular 2.0 has been reworked to be simple, yet extensible. It will include the following basic features:

A. Simple JSON-based Route Config
B. Optional Convention over Configuration
C. Static, Parameterized and Splat Route Patterns
D. URL Unresolver
Answer» A. Simple JSON-based Route Config
68.

Angular 2 has a . . . . . . . service that allows us to dynamically load a component in a certain position on the page.

A. DynamicControlLoader
B. DynamicControllerLoader
C. DynaCompLoader
D. DynamicComponentLoader
Answer» D. DynamicComponentLoader
69.

Angular 2 can detect when component data changes, and then automatically re-render the view to reflect that change.

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

AngularJS supports . . . . . kind(s) of data binding.

A. one
B. two
C. three
D. four
Answer» B. two
71.

AngularJS never regenerates the HTML again.

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

AngularJS bindings are . . . . . , meaning that when the value associated with the binding is changed (in the data model), the HTML element will be updated.

A. parallel
B. one way
C. two way
D. live
Answer» D. live
73.

You can use the . . . . . . directive, in order to bind the innerHTML of the element to the specified model property.

A. ng-bind
B. ng-binding
C. ng-binds
D. ng-bindings
Answer» A. ng-bind
74.

Any change to the . . . . and . . . . . properties affects these bindings and consequently the user interface content.

A. noOfTries, deviations
B. restart, tries
C. noOfTries, deviation
D. noOfTry, deviation
Answer» C. noOfTries, deviation
75.

In two-way binding, changes done to a model are reflected in the view, but the reverse also holds true sometimes.

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

You can create bindings only for the data values that are added to the . . . . . object by the controller.

A. $action
B. $control
C. $scope
D. none of above
Answer» C. $scope
77.

The ng-bind directive . . . . . . allow you to hide your template markup when the HTML content is shown to the user before it is processed by AngularJS.

A. does
B. does not
C. none
D. all
Answer» A. does
78.

The drawback of inline bindings is that AngularJS will not find and process every set of {{ and }} characters in your content.

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

When adding . . . . . and . . . . . . to a view, we are essentially instructing Angular to create data bindings that keep the model and view in sync.

A. extrapolations, interpolations
B. scopes, directives
C. directives, interpolation
D. none of above
Answer» C. directives, interpolation
80.

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
Chapter: AngularJS Modules, Controller, View and Scope
81.

AngularJS is based on the _____ pattern

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

What is Angular Js?

A. Library
B. Framework
C. Plugin
D. Browser Extension
Answer» B. Framework
83.

AngularJS applications are a mix of _____

A. HTML and PHP
B. HTML and CrossScript
C. HTML and AngularScript
D. HTML and JavaScriptcorrect
Answer» C. HTML and AngularScript
84.

How to include HTML content into another HTML?

A. Server Side push
B. Use of CommetD
C. Use of Polling
D. Use of include
Answer» D. Use of include
85.

What is MVC (Mode View Controller)?

A. It is a services for Java built function
B. It is marker for DOM elements
C. It is a software design pattern for developing web applications
D. None of the above
Answer» C. It is a software design pattern for developing web applications
86.

Which of the following is true about AngularJS service?

A. Services are JavaScript functions
B. Services are responsible to do specific tasks only
C. Inbuilt services are always prefixed with $ symbol
D. All of the above
Answer» D. All of the above
87.

Which of the following is valid for AngualarJS module

A. var app = angular.module(["myApp","param");
B. var app = angular.module("myApp", []);
C. var app = angular.module();
D. var app = angular.module("myApp");
Answer» D. var app = angular.module("myApp");
88.

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
89.

Which of the following is true about

A. $routeProvider $routeProvider maps Urls with the corresponding html page or ng-template
B. $routeProvider attaches a controller with the view
C. All of these
D. $routeProvider is the key service which set the configuration of urls
Answer» C. All of these
90.

Which is the right format for calling a ng-bind function?

A. ng-bind
B. ng:bind
C. ng_bind
D. All the Above
Answer» D. All the Above
91.

What is the purpose of angular.module in AngularJS?

A. It creates an application module
B. It invokes an application module
C. It destroys an application module
D. None
Answer» A. It creates an application module
92.

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, datang-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
93.

AngularJS controllers control ___of AngularJS applications.

A. the data
B. thefunction
C. thevariable
D. None of these
Answer» A. the data
94.

Which directive defines the application controller?

A. ng-model
B. ng-ctrl
C. ng-controller
D. None of these
Answer» C. ng-controller
95.

Whichdirectives bind the input fields to the controller properties?

A. data-ng-model
B. ng-app
C. ng-controller
D. None of these
Answer» A. data-ng-model
96.

In larger applications,controllers are stored in ___?

A. external files
B. scope object
C. internal files
D. None of these
Answer» A. external files
97.

Which statement is true about scope in AngularJS?

A. The scope is the binding part between the HTML (view) and the JavaScript (controller).
B. The scope is an object with the available properties and methods.
C. The scope is available for both the view and the controller.
D. All of the above
Answer» D. All of the above
98.

Controller, which is the JavaScript function that ___ the data?

A. Makes
B. Changes
C. Removes
D. All of the above
Answer» D. All of the above
99.

$rootScoperefers to an object which is accessible from everywhereof theapplication.

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

$rootScope is created with ___

A. ng-controller
B. ng-app
C. ng-init
D. None of these
Answer» B. ng-app
Tags
Question and answers in Angular-JS, Angular-JS multiple choice questions and answers, Angular-JS Important MCQs, Solved MCQs for Angular-JS, Angular-JS MCQs with answers PDF download