Angular JS/AngularJS MCQ Questions Sample Test,Sample questions

Question:
 AngularJS expressions are written inside _____.

1.{ expression }

2.[{ expression }]

3._expression

4.{{ expression }}


Question:
 AngularJS is a _____.

1.HTML Framework

2..Net Framework

3.JavaScript framework

4.Oracle Framework


Question:
 AngularJS is perfect for _______.

1.Create Single Page Applications

2. Creating a Desktop Application

3.Create Web Services

4.None of these


Question:
 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>

1.Prints the city names in an unordered list

2.Prints the city names in an ordered list

3.Prints the all name of the city 3 times in an unordered list

4.None of the above


Question:
 Filters can be added to expressions by using the ______, followed by a filter.

1.comma character (,)

2.Colon character (:)

3. Hyphen character (-)

4.pipe character (|)


Question:
 In AngularJS, what is the data binding?

1.Synchronization between controller part and view part

2.Synchronization between model part and controller part

3.Synchronization between model part and view part

4.None of the above


Question:
 Which AngularJS directive is used to hide or show an HTML element?

1.ng-showHide

2.ng-ShowHide

3.ng-show

4.ng-hide


Question:
 Which AngularJS filter formats a number to a string?

1.number

2.integer

3.int

4.num


Question:
 Which directive defines the application controller?

1.ng-control

2.ng-controller

3. ng-NewController

4.None of the above


Question:
 Which directive initializes an AngularJS application?

1.ng-app

2.ng-init

3. ng-model

4.ng-application


Question:
 Which directive initializes application data?

1.ng-app

2.ng-init

3. ng-model

4.ng-application


Question:
 Which directive repeats an HTML element?

1.ng-repeats

2. ng-iterate

3.ng-model

4. ng-repeat


Question:
 Which is not a valid method of $location service?

1.hostname()

2.host()

3.path()

4.hash()


Question:
 Which is the correct syntax of AngularJS directive ng-show?

1.ng-show:"true/false"

2.ng-show="true/false"

3.ng-app ng-show="true/false"

4.None of the above


Question:
 Which is the correct syntax to create a module?

1.var variable_name = angular.module("app_name", []);

2.var variable_name = angular.module("app_name", []);

3.var variable_name = angular.module("app_name", []);

4.var variable_name = angular.module("app_name", []);


Question:
 Which is the correct syntax to define multiple filters on an expression?

1.{{ expression | filter1 | filter2 | filter3 | ... }}

2.{{ expression | {filter1} | {filter2} | {filter3} | ... }}

3.{{ expression | {{filter1}} | {{filter2}} | {{filter3}} | ... }}

4.{{ expression | filter1 , filter2 , filter3 , ... }}


Question:
 Which method of $location service is used to get the current URL without any parameters?

1. url()

2.absUrl()

3.path()

4.absPath()


Question:
 Which method of $location service is used to get the URL without base prefix?

1.url()

2.Url()

3.WebUrl()

4.absUrl()


Question:
 Which module routes your application to different pages without reloading the entire application?

1.ngRoutes

2.route

3.ng-Route

4.ngRoute


Question:
 Which of the below is an Invalid filter in AngularJS?

1.JSON

2.limitTo

3.orderBy

4.email


Question:
A controller that takes a single parameter called ........

1.$control

2.$param

3.$scont

4.$scope


Question:
An AngularJS module defines an ______.

1.expression

2.application

3.element

4. None of the above


Question:
Angular JS belongs to the ..........

1.Google

2.Facebook

3.Microsoft

4.IBM


Question:
Angular JS is developed by ______.

1.Facebook

2.Oracle

3.Google

4.Microsoft


Question:
Angular Routing provides ______ ways to include the ng-view directive in your application.

1.<div ng-view></div>

2.<ng-view></ng-view>

3.<div class="ng-view"></div>

4.All of the above


Question:
AngularJS applications are a mixture of ...........

1.HTML and PHP

2.HTML and JavaScript

3.HTML and CrossScript

4.HTML and AngularScript


Question:
AngularJS is distributed as a _______.

1.JavaScript file

2. PHP file

3. XML file

4. ASP file


Question:
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>

1.The result is: Undefined

2.The result is: 0

3.The result is: 3

4.The result is: NaN


Question:
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>

1.The result is: 7.5

2.The result is: 7

3.The result is: 7.50

4.The result is: 3*2.5


Question:
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>

1.Prints the city names with "Hello" in an unordered list

2.Prints the city names with "Hello" in an ordered list

3.Prints the all name of the city with "Hello" 3 times in an unordered list

4.None of the above


Question:
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>

1.Syntax Error

2.Nothing will display

3.Displaying: 5

4.Displaying: 10


Question:
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>

1.The value is 10 + 30

2.The value is 40

3.The value is NaN

4.The value is Undefined


Question:
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>

1.The value is 10, 30

2.The value is 10, 0

3.The value is 10, NaN

4.The value is 10,


Question:
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>

1.StudentName

2.{{ StudentName }}

3.{ StudentName }

4.{ _StudentName }


Question:
In the below given statement, "myApp" parameter refers to ____.

1.a JavaScript code in which the application will run

2.a JSON file

3.an HTML element in which the application will run

4.SQL queries


Question:
The $event object contains the ______.

1.browser's event object

2.browser's current path

3. Both A. and B.

4.None of the above


Question:
The .subscribe in AngularJS is used for?

1. Streams data synchronously

2.Streams data asynchronously

3.Both of the above

4.None of the above


Question:
What is an Angular JS?

1.AngularJS is a JavaScript-based open-source back-end web framework

2.AngularJS is a Python-based open-source back-end web framework

3.AngularJS is a JavaScript-based open-source front-end web framework

4.None of the above


Question:
What is controller in MVC?

1.A software Code that stores the data.

2.A software Code that renders the user interface.

3.A software Code that controls the interactions between the Model and View.

4.None of the Above


Question:
Which among the following is an AngularJS Directives?

1.ng-app

2.ng-init

3.ng-model

4.All of the above


Question:
Which AngularJS directive is used to bind AngularJS application data to the disabled attribute of HTML elements?

1.ng-disabled

2. ng-disable

3.ng-disabledElement

4.ng-disableElement


Question:
Which AngularJS directive is used to define AngularJS code that will be executed when the element is being clicked?

1.ng-click

2.ng-mouseOver

3.ng-mouseClick

4.ng-mouse


Question:
Which AngularJS directive is used to show or hide an HTML element?

1.ng-showHide

2.ng-ShowHide

3.ng-show

4.ng-hide


Question:
Which AngularJS filter formats a date to a specified format?

1.datetime

2.time

3.date

4.ng-date


Question:
Which AngularJS filter formats a number to a currency format?

1.currency

2.number

3.dollar

4.curr


Question:
Which AngularJS filter formats a string to lower case?

1.lwr

2.lower

3.lowercase

4.ng-lowercase


Question:
Which AngularJS filter formats a string to upper case?

1.upr

2.upper

3.uppercase

4. ng-uppercase


Question:
Which AngularJS filter formats an object to a JSON string?

1.ng-json

2.json

3.set-json

4.None of the above


Question:
Which AngularJS filter limits an array/string, into a specified number of elements/characters?

1.limitTo ng-

2.limit

3.nglimit

4.nglimit


Question:
Which AngularJS filter orders an array by an expression?

1.orderby

2.orderBy

3.order

4.OrderBy


Question:
Which AngularJS filter selects a subset of items from an array?

1.set

2.subset

3.ng-set

4.filter


Question:
Which AngularJS function creates a new directive?

1..new ...

2.create

3.directive

4.CreateDirective


Question:
Which AngularJS function is used to create a module?

1.module

2. ng-bind

3.angular.create

4.angular.module


Question:
Which AngularJS service has the set of methods to get the information about the location of the current web?

1.$web

2. $current

3.$location

4. All of the above


Question:
Which AngularJS service is the version of the window.setInterval function?

1.$interval

2.$WindowInterval

3.$WinInterval

4.$setInterval


Question:
Which AngularJS service is the version of the window.setTimeout function?

1.$timeout

2.$WindowTimeout

3. $WinTimeout

4.$setTimeout


Question:
Which AngularJS service is used to make the request to the server?

1.$https

2. $reques

3.t $http

4.$requests


Question:
Which directive binds the value of HTML controls to application data?

1.ng-app

2.ng-init

3. ng-model

4. ng-application


Question:
Which directive can be used to write AngularJS expressions?

1.ng-expression

2.ng-bind

3.ng-statement

4.ng-bindexpression


Question:
Which is not a valid method of $location service?

1.hostname()

2.host()

3.path()

4.hash()


Question:
Which is the correct AngularJS statement to format the value of "studentName" in the uppercase?

1.{{ studentName.uppercase }}

2. {{ uppercase(studentName) }}

3.{{ uppercase.studentName }}

4. {{ studentName | uppercase }}


Question:
Which is the correct syntax to write an AngularJS expression using the ng-bind directive?

1.ng-bind="expression"

2.ng-bind={expression}

3.ng-bind={"expression"}

4.ng-bind="{{expression}}"


Question:
Which method of $location service is used to get the full URL of the current web page?

1.url()

2.Url()

3.WebUrl()

4.absUrl()


Question:
Which method of $location service is used to get the search part of the current URL when called without any parameter?

1.searchPath()

2.absSearch()

3.ruleSearch()

4.search()


Question:
Which of the following angular function is used to manually start up an angular application?

1.angular.copy

2.angular.element

3.angular.bootstrap

4.None of the Above


Question:
Which of the following angular function is used to manually start up an angular application?

1.angular.copy

2.angular.element

3.angular.bootstrap

4.None of the Above


Question:
Which of the following can be used as a prefix for Directive?

1.data-

2.ng-

3.Both A and B

4.None of the above


Question:
Which of the following directive binds the values of application data to HTML input controls in angular JS?

1.ng-app

2.ng-model

3.ng-bind

4.None of the above


Question:
Which of the following directive is used to hide a given control?

1.ng- cover

2.ng- hide

3.ng- disbaled

4.None of the Above


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

1.ng-app

2.ng-model

3.ng-controller

4.None of the Above


Question:
Which of the following directive is used to start an angularJS application?

1.ng-start

2.ng-begin

3.ng-app

4.None of the Above


Question:
Which of the following function is used to create a module?

1.add.module()

2.create.module()

3.angular.module()

4.None of the Above


Question:
Which of the following is a priority level of directives?Which of the following is a priority level of directives?

1.Level 1

2.Level 2

3.Level 3

4.All are Correct


Question:
Which of the following is true about $error?

1.$error states the exact error.

2.$error states that form has invalid data.

3.$error states the invalid error.

4.None of the Above


Question:
Which of the following is true about ng-show directive?

1.Ng-show directive can hide a given control.

2.Ng-show directive can show a given control.

3.Both A & B

4.None of the Above


Question:
Which of the following service converts object to the string?

1.$htpp

2.$interval

3.$httpParamSerializer

4.None of the Above


Question:
Which of the following service is used to communicate with a remote server?

1.$animate

2.$timeout

3.$http

4.None of the Above


Question:
Which of the following sign is used as a prefix for the built-in objects in AngularJS?

1.#

2.@

3.$

4.%


Question:
Which prefix is used with the AngularJS directives?

1.ag-

2.ng-

3.aj-

4. All of the above


Question:
Who developed AngularJS?

1. Jesse James Garrett

2.Douglas Crockford

3.Miško Hevery

4.Brendan Eich


Question:
Who maintained AngularJS?

1.Google

2.A community of individuals and corporations

3.Oracle

4. Both A. and B.


Question:
With the _____ you can define what page to display when a user clicks a link.

1.$routeCaller

2.$routeProvider

3.Both A and B

4.None of the above


Question:
Write a statement with <div> element to initialize two variables (name and age)?

1.<div ng-app="" ng-init="Name:'Alex';Age:21">

2.<div ng-app="" ng-init="Name:'Alex',Age:21">

3.<div ng-app="" ng-init="Name='Alex',Age=21">

4.<div ng-app="" ng-init="Name='Alex';Age=21">


More MCQS

  1. AngularJS MCQ Questions
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!