Olete.in
Articles
Mock Tests
๐งช Angular JS MCQ Quiz Hub
AngularJS MCQ Questions
Choose a topic to test your knowledge and improve your Angular JS skills
1. What is controller in MVC?
A software Code that stores the data.
A software Code that renders the user interface.
A software Code that controls the interactions between the Model and View.
None of the Above
2. Which of the following is true about ng-show directive?
Ng-show directive can hide a given control.
Ng-show directive can show a given control.
Both A & B
None of the Above
3. Which of the following is true about $error?
$error states the exact error.
$error states that form has invalid data.
$error states the invalid error.
None of the Above
4. Angular JS belongs to the ..........
Google
Facebook
Microsoft
IBM
5. Which of the following directive is used to start an angularJS application?
ng-start
ng-begin
ng-app
None of the Above
6. Which of the following directive binds the values of application data to HTML input controls in angular JS?
ng-app
ng-model
ng-bind
None of the above
7. Which of the following sign is used as a prefix for the built-in objects in AngularJS?
#
@
$
%
8. Which of the following is a priority level of directives?Which of the following is a priority level of directives?
Level 1
Level 2
Level 3
All are Correct
9. Which of the following service is used to communicate with a remote server?
$animate
$timeout
$http
None of the Above
10. Which of the following service converts object to the string?
$htpp
$interval
$httpParamSerializer
None of the Above
11. Which of the following directive is used to hide a given control?
ng- cover
ng- hide
ng- disbaled
None of the Above
12. Which of the following function is used to create a module?
add.module()
create.module()
angular.module()
None of the Above
13. Which of the following angular function is used to manually start up an angular application?
angular.copy
angular.element
angular.bootstrap
None of the Above
14. A controller that takes a single parameter called ........
$control
$param
$scont
$scope
15. AngularJS applications are a mixture of ...........
HTML and PHP
HTML and JavaScript
HTML and CrossScript
HTML and AngularScript
16. Which of the following directive is used to initialize an angular app?
ng-app
ng-model
ng-controller
None of the Above
17. Angular JS is developed by ______.
Facebook
Oracle
Google
Microsoft
18. Angular Routing provides ______ ways to include the ng-view directive in your application.
<div ng-view></div>
<ng-view></ng-view>
<div class="ng-view"></div>
All of the above
19. With the _____ you can define what page to display when a user clicks a link.
$routeCaller
$routeProvider
Both A and B
None of the above
20. Which among the following is an AngularJS Directives?
ng-app
ng-init
ng-model
All of the above
21. What is an Angular JS?
AngularJS is a JavaScript-based open-source back-end web framework
AngularJS is a Python-based open-source back-end web framework
AngularJS is a JavaScript-based open-source front-end web framework
None of the above
22. AngularJS is perfect for _______.
Create Single Page Applications
Creating a Desktop Application
Create Web Services
None of these
23. AngularJS is a _____.
HTML Framework
.Net Framework
JavaScript framework
Oracle Framework
24. AngularJS is distributed as a _______.
JavaScript file
PHP file
XML file
ASP file
25. Who developed AngularJS?
Jesse James Garrett
Douglas Crockford
Miลกko Hevery
Brendan Eich
26. Who maintained AngularJS?
Google
A community of individuals and corporations
Oracle
Both A. and B.
27. AngularJS expressions are written inside _____.
{ expression }
[{ expression }]
_expression
{{ expression }}
28. Which directive can be used to write AngularJS expressions?
ng-expression
ng-bind
ng-statement
ng-bindexpression
29. Which is the correct syntax to write an AngularJS expression using the ng-bind directive?
ng-bind="expression"
ng-bind={expression}
ng-bind={"expression"}
ng-bind="{{expression}}"
30. An AngularJS module defines an ______.
expression
application
element
None of the above
31. Which AngularJS function is used to create a module?
module
ng-bind
angular.create
angular.module
32. Which is the correct syntax to create a module?
var variable_name = angular.module("app_name", []);
var variable_name = angular.module("app_name", []);
var variable_name = angular.module("app_name", []);
var variable_name = angular.module("app_name", []);
33. In the below given statement, "myApp" parameter refers to ____.
a JavaScript code in which the application will run
a JSON file
an HTML element in which the application will run
SQL queries
34. Which prefix is used with the AngularJS directives?
ag-
ng-
aj-
All of the above
35. Which directive initializes an AngularJS application?
ng-app
ng-init
ng-model
ng-application
36. Which directive initializes application data?
ng-app
ng-init
ng-model
ng-application
37. Which directive binds the value of HTML controls to application data?
ng-app
ng-init
ng-model
ng-application
38. Which directive repeats an HTML element?
ng-repeats
ng-iterate
ng-model
ng-repeat
39. Write a statement with <div> element to initialize two variables (name and age)?
&lt;div ng-app=&quot;&quot; ng-init=&quot;Name:&#039;Alex&#039;;Age:21&quot;&gt;
&lt;div ng-app=&quot;&quot; ng-init=&quot;Name:&#039;Alex&#039;,Age:21&quot;&gt;
&lt;div ng-app=&quot;&quot; ng-init=&quot;Name=&#039;Alex&#039;,Age=21&quot;&gt;
&lt;div ng-app=&quot;&quot; ng-init=&quot;Name=&#039;Alex&#039;;Age=21&quot;&gt;
40. Consider the below statement, how to print the value of "StudentName"? <div ng-app="" ng-init="firstName='John'"> <p>Input something in the input box:</p> <p>Name: <input type="text" ng-model="StudentName"></p> <p>You wrote: _______</p> </div>
StudentName
{{ StudentName }}
{ StudentName }
{ _StudentName }
41. Consider the below statement โ what will be the output? <div data-ng-app="" data-ng-init="qty=3;price=2.5"> <p>The result is: {{qty * price}}</p> </div>
The result is: 7.5
The result is: 7
The result is: 7.50
The result is: 3*2.5
42. Consider the below statement โ what will be the output? <div data-ng-app="" data-ng-init="qty=3;"> <p>The result is: {{qty * price}}</p> </div>
The result is: Undefined
The result is: 0
The result is: 3
The result is: NaN
43. Consider the below statement โ what will be the output? <div ng-app="" ng-init="cities=['Mumbai','New Delhi','Banglore']"> <p>The cities...</p> <ul> <li ng-repeat="c in cities"> {{ c }} </li> </ul> </div>
Prints the city names in an unordered list
Prints the city names in an ordered list
Prints the all name of the city 3 times in an unordered list
None of the above
44. Consider the below statement โ what will be the output? <div ng-app="" ng-init="cities=['Mumbai','New Delhi','Banglore']"> <p>The cities...</p> <ul> <li ng-repeat="c in cities"> "Hello" {{ c }} </li> </ul> </div>
Prints the city names with &quot;Hello&quot; in an unordered list
Prints the city names with &quot;Hello&quot; in an ordered list
Prints the all name of the city with &quot;Hello&quot; 3 times in an unordered list
None of the above
45. Consider the below statement โ what will be the output? <div ng-app="" ng-init="values=[10, 20, 30]"> <p>The value is {{values[0]}}, {{values[3]}}</p> </div>
The value is 10, 30
The value is 10, 0
The value is 10, NaN
The value is 10,
46. Consider the below statement โ what will be the output? <div ng-app="" ng-init="values=[10, 20, 30]"> <p>The value is {{values[0]}} + {{values[2]}}</p> </div>
The value is 10 + 30
The value is 40
The value is NaN
The value is Undefined
47. Which AngularJS function creates a new directive?
.new ...
create
directive
CreateDirective
48. Which directive defines the application controller?
ng-control
ng-controller
ng-NewController
None of the above
49. Filters can be added to expressions by using the ______, followed by a filter.
comma character (,)
Colon character (:)
Hyphen character (-)
pipe character (|)
50. Which AngularJS filter formats a number to a currency format?
currency
number
dollar
curr
51. Which AngularJS filter formats a date to a specified format?
datetime
time
date
ng-date
52. Which AngularJS filter selects a subset of items from an array?
set
subset
ng-set
filter
53. Which AngularJS filter formats an object to a JSON string?
ng-json
json
set-json
None of the above
54. Which AngularJS filter limits an array/string, into a specified number of elements/characters?
limitTo ng-
limit
nglimit
nglimit
55. Which AngularJS filter formats a string to lower case?
lwr
lower
lowercase
ng-lowercase
56. Which AngularJS filter formats a string to upper case?
upr
upper
uppercase
ng-uppercase
57. Which AngularJS filter formats a number to a string?
number
integer
int
num
58. Which AngularJS filter orders an array by an expression?
orderby
orderBy
order
OrderBy
59. Which is the correct AngularJS statement to format the value of "studentName" in the uppercase?
{{ studentName.uppercase }}
{{ uppercase(studentName) }}
{{ uppercase.studentName }}
{{ studentName | uppercase }}
60. Which of the following can be used as a prefix for Directive?
data-
ng-
Both A and B
None of the above
61. Which is the correct syntax to define multiple filters on an expression?
{{ expression | filter1 | filter2 | filter3 | ... }}
{{ expression | {filter1} | {filter2} | {filter3} | ... }}
{{ expression | {{filter1}} | {{filter2}} | {{filter3}} | ... }}
{{ expression | filter1 , filter2 , filter3 , ... }}
62. Which AngularJS service has the set of methods to get the information about the location of the current web?
$web
$current
$location
All of the above
63. Which method of $location service is used to get the full URL of the current web page?
url()
Url()
WebUrl()
absUrl()
64. Which method of $location service is used to get the URL without base prefix?
url()
Url()
WebUrl()
absUrl()
65. Which method of $location service is used to get the current URL without any parameters?
url()
absUrl()
path()
absPath()
66. Which is not a valid method of $location service?
hostname()
host()
path()
hash()
67. Which method of $location service is used to get the search part of the current URL when called without any parameter?
searchPath()
absSearch()
ruleSearch()
search()
68. Which is not a valid method of $location service?
hostname()
host()
path()
hash()
69. Which AngularJS service is used to make the request to the server?
$https
$reques
t $http
$requests
70. Which AngularJS service is the version of the window.setTimeout function?
$timeout
$WindowTimeout
$WinTimeout
$setTimeout
71. Which AngularJS service is the version of the window.setInterval function?
$interval
$WindowInterval
$WinInterval
$setInterval
72. In AngularJS, what is the data binding?
Synchronization between controller part and view part
Synchronization between model part and controller part
Synchronization between model part and view part
None of the above
73. Which AngularJS directive is used to bind AngularJS application data to the disabled attribute of HTML elements?
ng-disabled
ng-disable
ng-disabledElement
ng-disableElement
74. Which AngularJS directive is used to show or hide an HTML element?
ng-showHide
ng-ShowHide
ng-show
ng-hide
75. Which AngularJS directive is used to hide or show an HTML element?
ng-showHide
ng-ShowHide
ng-show
ng-hide
76. Which AngularJS directive is used to define AngularJS code that will be executed when the element is being clicked?
ng-click
ng-mouseOver
ng-mouseClick
ng-mouse
77. Which is the correct syntax of AngularJS directive ng-show?
ng-show:&quot;true/false&quot;
ng-show=&quot;true/false&quot;
ng-app ng-show=&quot;true/false&quot;
None of the above
78. Consider the below statement โ what will be the output? <div ng-app="" ng-init="num=10"> <p ng-show="num > 5">Displaying: {{num}}</p> </div>
Syntax Error
Nothing will display
Displaying: 5
Displaying: 10
79. The $event object contains the ______.
browser&#039;s event object
browser&#039;s current path
Both A. and B.
None of the above
80. Which module routes your application to different pages without reloading the entire application?
ngRoutes
route
ng-Route
ngRoute
81. Which of the below is an Invalid filter in AngularJS?
JSON
limitTo
orderBy
email
82. The .subscribe in AngularJS is used for?
Streams data synchronously
Streams data asynchronously
Both of the above
None of the above
Submit