Learn. Practice. Feel prepared.
Angular JS Objective Questions and Answers
Test your AngularJS knowledge with carefully curated multiple-choice questions covering core concepts such as ng-app, directives, modules, dependency injection, MVC architecture, expressions, services, providers, and application initialization.
Practice Angular JS MCQs with Detailed Explanations
Answer at least 12 questions to submit and verify answers.
1 Which of the following is true about ng-app directive?
Correct answer:
Both of the above.
2 How angular.module works?
Correct answer:
Both of the above.
3 Which of the following is true about ng-init directive?
Correct answer:
Both of the above.
4 Which of the following directive is used to initialize an angular app?
Correct answer:
ng-app
5 AngularJS expressions are written using.
Correct answer:
double braces like {{ expression}}
6 Angular initializes based upon which of the following scenario?
Correct answer:
Both of the above
7 With more than one ng-app in an HTML document (an HTML page), are all of them automatically initialized?
Correct answer:
No, only one app is automatically initialized. Others have to manually initialized.
8 What are various possible prefixes such as ‘ng-‘ using which Angular directives (for example, ng-app) can be defined?
Correct answer:
'ng-', 'data-ng-', 'ng:', 'x-ng-'
9 What are various possible ways in which angular application can be initialized?
Correct answer:
Both of the above
10 What angular function is used to manually start up an angular application?
Correct answer:
angular.bootstrap
11 Which components can be injected as a dependency in AngularJS?
Correct answer:
Application Module
12 Which of the following is true about AngularJS service?
Correct answer:
All of the above.
13 What is View in MVC?
Correct answer:
View is responsible for displaying all or a portion of the data to the user.
14 Which of the following is true about $error?
Correct answer:
$error states the exact error.
15 Which of the following is true about provider?
Correct answer:
All of the above.
16 Which of the following is true about ng-bind directive?
Correct answer:
All of the above.
ng-bind directive binds the AngularJS Application data to HTML tags. ng-bind updates the model created by ng-model directive to be displayed in the html tag whenever user input something in the control or updates the html control's data when model data is updated by controller.
17 Which of the following is true about $dirty flag?
Correct answer:
$dirty flag states that value has been changed.
18 At framework level, how does Angular retrieve the matching elements for processing?
Correct answer:
Both of the above
19 Directives can be applied to which all element type?
Correct answer:
All of the above
20 There is a controller which takes single parameter. We call it . . . . . parameter.
Correct answer:
$scope
21 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 which of the following?
Correct answer:
HTML injection attacks
22 First the HTML document is loaded into the browser, and evaluated by the browser. At this time the AngularJS does which of the following?
Correct answer:
all of above