AngularJS Тест Fiverr

i) ng-app="module"
ii) $injector
iii) $compile
iv) $rootScope
From the options given below, choose the one that describes what occurs during auto-bootstrapping of an angular application.

 i) invokes ii).
ii) invokes iii) and iv).

i) invokes iii).
iii) invokes ii) and iv).

iv) invokes iii).
iii) invokes i) and ii).

iii) invokes ii).
ii) invokes i) and iv).

In AngularJS, every bookmarkable URL is called a:

Model
Module
Route
Tag

In which of the following does Angular provide the RESTful functionality?

$httpBackend service
ngResource module
angular.mock.module function
angular.noop function

A bootstrap event of AngularJS is fired in a single page application. In this situation, how many ng-app directives will be processed?

0
1
2
Non-deterministic

Which of the following sentences is correct about the following code snippet?
A) The last line of the code will evaluate to false.
B) Scopes do not follow inheritance, i.e. "c" will not inherit the scope of "p".

var p = $rootScope;
var c = p.$new();

p.salutation = "Sir";
expect(c.salutation).toEqual('Sir');

Statements A and B are true. Statement B is the correct explanation of Statement A.
Statements A and B are true. Statement B is not the correct explanation of Statement A
Statement A is true, but Statement B is false.
Statements A and B are false.

Which of the following directives is NOT supported by the ngAria module?

ngModel
ngHide
ngDisabled
ngRepeat

The following snippet is used in an HTML file to insert the angular.js framework file:
"<script src = 'angular.js'></script>".
Given below are some statements regarding angular control over the page. Which of them is true?

Angular will take control over the web page.
Core AngularJS has more dependency than the angular.js file, so we need to include those too.
We need to define the scope in the html file using a special directive where angular will have its control.
Angular will take control over the web page, but the behavior of angular will be unsatisfactory.

Is it possible to create nested scopes that do not inherit properties from their parent scopes?

Yes
No

Which of the following statements is/are INCORRECT about the angular.extend function?
1. You cannot specify more than one src object in this function.
2. You can pass an empty object as the target to preserve the original objects.
3. This function does not support recursive merge.

Only 1 is incorrec
Only 3 is incorrect
Both 1 and 2 are incorrect
Both 2 and 3 are incorrect

Which of the following options is the function of the given Service Fabric CLI command?
sfctl node list --query "sort_by(items[*], &name)[-1].name

Retrieve the node-name value of the last created node.
Retrieve the name of the last created node.
Sort the name of the nodes according to the number of items present in a node.
None of the above.

The GET method using the HTTP service fails to receive a response from the server. How will the AngularJS application react to this scenario?

The application will terminate.
The method waiting for the response will terminate.
The method waiting for the response may redirect it to the error-handling function.
The method will wait indefinitely until the response is received

Which of the following statements is/are TRUE about directives in AngularJS?
1. Custom HTML tags can be created using directives.
2. Directives are functions bound to a particular scope.
3. Directives are singleton objects that can be instantiated only once in an application.

Only 1
Only 2
Both 2 and 3
Both 1 and 3

Which of the following $http functions CANNOT take a "data" parameter?

$http.get()
$http.put()
$http.post()
$http.delete()

Which of the following statements about the parts of AngularJS frameworks are correct?
1. ng-app defines and links an AngularJS application to HTML.
2. ng-model binds the values of AngularJS application data to a cloud model.
3. ng-bind binds the AngularJS application data to HTML tags.

Both 1 and 2
Both 2 and 3
Both 1 and 3
All 1, 2, and 3

Which of the following services is used to create the root scope during the application bootstrap?

$init
$watch
$injector
$apply

Consider that a service called $http makes server calls. Which of the following examples about the dependency injection in AngularJS is correct?
Example 1:
function fetchDashboardData()
{
var $http = new HttpService();
return $http.get('my/url');
}
Example 2:
function fetchDashboardData($http)
{
return $http.get('my/url');
}

Example 1
Example 2
Both options a and b
Neither option a nor b

Which of the following options is NOT a built-in filter component used in AngularJS?

orderBY
time
date
lowercase

In Distributed Architecture Structure, which of the following statements about the service layer are correct?
1. The service layer is used to identify and manage the types of services that can be offered.
2. It directly communicates to the resource manager to validate the type of service required by a user.
3. It is not responsible for updating about the resource availability.

Both statements 1 and 2 are correct.
Both statements 1 and 3 are correct.
Both statements 2 and 3 are correct.
All statements 1, 2, and 3 are correct.

This question is based on the graphic shown below.
The AngularJS code shown in Figure 1 of the image was supposed to give the output shown in Figure 2 but is giving a different output. Which of the following code lines should be modified to obtain the required output?

Line 5
Line 7
Line 16
Both lines 7 and 16
Both lines 16 and 17

How many child scopes can an AngularJS application have?

Only one
Two
Five
Any number

This question is based on the graphic shown below.
Which line of the given code contains the attribute that tells which part of the HTML contains the AngularJS app?

Line 3
Line 6
Line 5
Line 10
Line 11

What is the most ideal and professional approach to store variables in a controller, which you want to later access in another controller?

It is not possible to store variables in a controller, which you want to later access in another controller.
Using $rootScope via prototypical inheritance is the most ideal way to do this.
Using Angular Services is the most ideal way to do this.
None of the above serves the required case.

This question is based on the graphic shown below.
What will be the output of the given AngularJS code?

 GLENN MAXWELL
fee: $455.00
C language, marks:77
Java language, marks:87
Python language, marks:67

 glenn maxwell
fee: $455.00
C language, marks:77
Java language, marks:87
Python language, marks:67

 GLENN MAXWELL
fee: $455.00
Python language, marks:67
Java language, marks:87
C language, marks:77

 Glenn Maxwell
fee: $455.00
Python language, marks:67
Java language, marks:87
C language, marks:77

The value of the query parameter P (value: X) in a URL has to be changed to X + 2. Minimum how many times should the search method of the $location service be used to achieve this functionality?

2
3
4
5

This question is based on the graphic shown below.
What will be the output of the given AngularJS code?

AngularJS
Hi !
Amount : null Rs
Roll No:
Marks:

AngularJS
78,93,71,79,68

AngularJS
Hi Mark Tayler!
Amount : 30 Rs
Roll No: 101
Marks: 68

AngularJS
Hi Mark Tayler!
Amount : 30 Rs
Roll No: 101
Marks: 79

Which AngularJS directive is used to bind data values of an AngularJS application to HTML input controls?

ng-app
ng-model
ng-bind
ng-controller

Which of the functions given below is used for serializing common angular objects into strings?

angular.mock.inject
angular.mock.dump
angular.mock.module

Which of the following is NOT one of the special variables defined by the ng-repeat directive?

$index
$next
$first
$last

You are given a nested Directive Structure. Suppose that the parent node, on receiving the data, broadcasts the information to render to its child directives. How will the broadcast be emitted and received within the parent scope?

 emit - $scope.emit('render', data)
receive - $scope.render(function(data){})

emit - $scope.$broadcast('render', data)
receive - $scope.$on('render', function(data){})

emit - $scope.$broadcast('render', data)
receive - $scope.render(function(data){})

emit - $scope.$emit('render', data)
receive - $scope.$on('render', function(data){})

Which part of the MVC architecture holds an application's data and defines the logic that manages that data?

Model
View
Controller

Which directive works exactly like the ngClassOdd and ngClassEven directives except that while it works individually, the last two work together with the ngRepeat directive?

ngCloak
ngCsp
ngClass
ngIf

Consider the AngularJS code given in Figure 1 of the image. Which of the following should replace the "??" symbol in the form tag so as to obtain the output shown in Figure 2?

 <select ng-model="myForm.nm" ng-options="nm.id as nm.name for obj in myForm.options" > </select>
 <select ng-module="myForm.nm" ng-options="nm.id as nm.name for obj in myForm.options" > </select>
<select ng-model="myForm.nm" ng-options="obj.id as obj.name for obj in myForm.options" > </select>
<select ng-module="myForm.nm" ng-options="obj.id as obj.name for obj in myForm.options" > </select>

In Distributed Architecture Structure, which of the following groups undergoes configuration by using the scope?
1. Global
2. Environment-specific
3. Service-specific
4. Instance-specific

Only 1 and 3
Only 2 and 4
Only 1, 2, and 3
All 1, 2, 3, and 4

Which of the following can be used to associate controllers with scope objects implicitly?

ngController directiveng
Class directive
$route service

Which of the following is the correct syntax of the whenPUT() method of the $httpBackend service?

whenPUT(url, [headers], [actions] );
whenPUT(http method, [headers], url, [data] );
whenPUT(actions, [data], [headers]);
whenPUT(url, [data], [headers]);

This question is based on the graphic shown below.
What will be the output of the AngularJS code given below?

Statement1 - 20.5
Statement2 - 15.5
Statement3 - 36.0
Statement4 - 40.0

Statement1 - 20.5
Statement2 - a + 15.5
Statement3 - a - 20.5
Statement4 - a + 25.5

Statement1 - 5 + 15.5
Statement2 - a + 15.5
Statement3 - a - 20.5
Statement4 - a + 25.5

Statement1 - 20.5
Statement2 - 15.5
Statement3 - 20.5
Statement4 - 25.5

Which of the statements given below is/are correct about the ngApp directive?
1. You can auto-bootstrapp only one AngularJS application per HTML document.
2. No AngularJS module can be specified to be used as the root module for the application.
3. You can nest one AngularJS application within another AngularJS application.

Only
Only 2
Only 3
Both 1 and 3
Both 2 and 3

Which of the following methods is NOT used by $compileProvider?

register(name, factory);
directive(name, directiveFactory);
debugInfoEnabled([enabled]);
aHrefSanitizationWhitelist([regexp]);

Which of the following symbols can be used to add filters to directives?

!
#
|
&

A developer defines an image tag whose source is evaluated through a binding expression (<img src = '{{image}}' />).
In relation to the image load event, which of the following statements is/are true?
1) A 404 error will be reported by the image tag initially.
2)To prevent the 404 error, ng-src can be used instead of src.
3) ng-src sets the src value of the image as soon as the corresponding binding value gets evaluated.

Only 2 and 3.
Only 1.
All of them.
Only 1 and 2.

Which of the following methods can be used to create a service?

Only factory
Only service
Both factory and service

In a gaming application of Service Fabric, which of the following statements about actors are correct?
1. Actors are used to create new user profiles, send chat messages, or trade items between the players.
2. Adding more different actor types allow us to scale parts of our backend up and down with higher granularity.
3. The number of division of actors is restricted in the Service Fabric application.

Both statements 1 and 3 are correct.
Both statements 1 and 2 are correct.
Both statements 2 and 3 are correct.
All statements 1, 2, and 3 are correct.

<d1>
        <d2></d2>
        <d3>
                <d4></d4>
        </d3>
</d1>
d1, d2, d3 and d4 are AngularJS directives. Find the order in which the post-link event of these directives lifecycle occurs.

 d1, d2, d3, d4
d2, d4, d3, d1
d4, d3, d2, d1
d3, d4, d2, d1

Which of the following ways can be used in AngularJS to send AJAX requests to the server?

REST API calls.
JSONP calls through the $http service.
AJAX calls through the $http service.
Both a and c.
a, b and c.

Choose the function that can execute an expression from outside of the Angular framework.

$watchCollection();
$destroy();
$apply();
$eval();

The $normalize(name) method, prefixed with data-, converts an attribute name to which form?

Normalized, lowercase form
Normalized, uppercase form
Normalized, camelcase form
Normalized, propercase form

Which of the given parameters of $resource() are optional?

url
paramDefaults
actions
options

AngularJS expressions are written inside which of the following symbols?

(( ))
{( )}
{{ }}
[{ }]

Which of the following statements is/are true about AngularJS?

Two-way binding is not possible using AngularJS.
It supports both client and server communication
It has no pre-defined form validations.
It does not support animations.
Both options a and c are true.

In Service Fabric (PowerShell), which of the following commands is used to retrieve the status of each node available in a cluster?

Get-ServiceFabricClusterHealth
Get-SFCTLClusterHealth
Get-ServiceFabricClusterStatus
None of the above.

In Distributed Architecture Structure, which of the following layers is used to establish and delete the network connections?

Service
Transport
Both options a and b
Neither option a nor b

If a conditional expression for an ng-if directive on a div element evaluates to false, then which of the following options correctly describes the result of this event?

The div tag will be hidden using CSS properties.
The visibility of the div tag will be made 0 using CSS properties.
The div tag will be entirely removed from the DOM.
The div tag will become visible in the view.

Which object does the $http.get() function return?

config
url
response
promise

Consider that you are creating a Service Fabric CLI application. You are unable to view the build definition template. Which of the following options is considered as the major reason behind the given condition?

Newly created YAML pipeline creation experience feature is turned on.
Newly created YAML pipeline creation experience feature is turned off.
YAML pipeline creation experience feature is not installed.
None of the above.

When $http.get returns a particular object, what method does this object invoke when getting the response?

resolve
then
execute
run

It is given that there is an HTTP service that receives a transmitted JSON file. In what form will the final data be?

A string, which is de-serialized manually using json api to convert it into a json object.
A JavaScript object. The http service will de-serialize the received json file automatically.
A special format provided by the http service, especially for angular using the UTF-8 specification.
None of the above.

Which of the following services helps run functions asynchronously?

$interpolate
$document
$q
$compile

This question is based on the graphic shown below.
Analyze the AngularJS code given in Figure 1 of the image, and choose its correct output from the options given in Figure 2.

(a)
(b)
(c)

This question is based on the graphic shown below.
Analyze the AngularJS code given in Figure 1 of the image, and choose its correct output from the options given in Figure 2.

(a)
(b)
(c)
(d)
(e)

State whether the following statement is True or False:
The $scope.$watch() and $scope.$digest() functions are automatically called by AngularJS; they cannot be called manually.

True
False

Which of the following is the correct syntax of the whenGET() method of the $httpBackend service?

whenGET(actions, [data], [headers]);
whenGET(url, [headers]);
whenGET(url, [headers], [actions] );
whenGET([actions], [data], url );

Which service does the HTML $compile service use for the purpose of data binding?

$locale
$sce
$filter
$interpolate

Which of the following CSS classes depicts that the state of the input control has been changed by the user?

ng-pristine
ng-touched
ng-invalid
ng-dirty

What is the use of $injector in AngularJS?

It is a service locator that is used to retrieve the name of the module to be created.
It is a function that is used to reload the current application with debug information turned on.
It is a service locator that is used to retrieve object instances.
It is a function that is used to determine the undefined reference.

The ngChange directive in AngularJS executes at:

Priority level 0.
Priority level 10.
Priority level 100.
Priority level 1000

Which of the following is NOT a property of the angular.version object?

codeID
codeName
major
minor

Suppose that you used the following statement to create a scope variable in AngularJS.
var p = $rootScope;
If you want to create a child of "p" but don't want it to inherit the scope of "P", then which of the following options must be followed?

The "inherit" parameter in the $new() function must be "false" while creating the child.
The child will always inherit its parent's scope.
The "isolate" parameter in the $new() function must be "true" while creating the child.
The child will never inherit its parent's scope.

In Distributed Architecture Structure, which of the following conditions addresses the issue of data ownership at a storage location?

The data available in different storage devices is moved to the cloud.
The data that occupies a large memory space is deleted.
The storage devices owned by the data owners can be moved next to the big data centers for fast path access to compute clusters.
None of the above.

If the HTML template display causes a flickering effect in an AngularJS application, which directive can be used to avoid that effect?

ngTransclude
ngSwitch
ngCloak
ngIf

$routeProvider can be configured by calling which of the following functions?

otherwise()
when()
whenGet()
whenHead()

It is given that pagination is implemented to browse the menu of a shopping website implemented in AngularJS. For the click event on the next-page button, how would you implement the change of URL? (Take the URL as www.xxx.com#?page=2)

var current = $location.search('page');
$location.search('page', current + 1)

var current = $location.search('page');
$location.set('page', current+1);

var current = $location.search()['page'];
$location.set('page', current+1);

var current = $location.search()['page'];
$location.search('page', current + 1);

Which of the following are correct about AngularJS?

It does not support RESTfull services.
It allows adding custom directives.
It supports dependency injection.
It supports angular templates but not static templates.

Which of the following functions return chaining when used as setters?

useApplyAsync([value]);
hashPrefix([prefix]);
debugInfoEnabled([enabled]);
html5Mode([mode]);

The given code snippet adds properties in a controller. How will you refer to a property named, BusinessObject, in the view or front-end under an <h1></h1> HTML tag?
var app = angular.module('yourApp', []);
app.controller('yourController', function($scope) {
    $scope.BusinessObject = "Business Object";
});

<h1>{{BusinessObject}}</h1>
<h1>{{$BusinessObject}}</h1>
<h1>{{scope.BusinessObject}}</h1>
<h1>{{$scope.BusinessObject}}</h1>

Which of the services given below parses the Uniform Resource Locator (URL) in the address bar of the browser and makes that URL available to the application?

$location
$parse
$q
$sce

Which of the following CSS classes depicts that the user has not yet communicated with the input control?

ng-touched
ng-pending
ng-dirty
ng-pristine

Which of the services indicated below provides primitive DOM manipulation functions to insert, remove as well as move elements within the DOM?

$anchorScroll
$animate
$controller
$document

The ngChange expression in AngularJS is evaluated:

Only when the input value is invalid continuously since the model will stay null.
Only when the model has modified programmatically and not by changing the input value.
Only when there is no modification in the value that is returned from the $parsers transformation pipeline.
Only when a modification in the input value causes a new value to be committed to the model

Which directive executes at priority level 1000?

ngBindHtml
ngChange
ngClick
ngRepeat

Which of the following is the correct syntax of the jsonp() method of the $http service?

jsonp([config]);
jsonp(url, [config]);
jsonp(url, [config], data);
jsonp( data, [config]);

The following AngularJS expression is used to get data from a server. Which of the given statements is correct?
var data = $http.get(url);
 "data" is an http response object.

The get() method in the given code returns a string containing the server response data.
A promise object is returned by the get() method in the given code.
"data" is a deferred object.
var MainController = function($scope)

{
    var person = {
        firstName : "Sunny",
        lastName : "Kumar",
        Src : "localhost/mytest.png"
    };
Analyze the given code snippet. Which of the following statements is incorrect about the above code snippet?

Binding expressions inside the MainController scope cannot use the object, person.
person acts as a model to the scope object.
$scope is not a necessary parameter here.
We can have objects as models bound to $scope.

Consider that you are building a shopping cart application by using AngularJS. Which of the following statements about the given code snippet are correct?
<div class="right">
   <i class="fa fa-check" ng-show="!item_striken$index" ng-click="item_striken$index = !item_striken$index"></i>
   <i class="fa fa-times" ng-show="item_striken$index" ng-click="item_striken$index = !item_striken$index"></i>  
   <i class="fa fa-trash" ng-click="deleteItem($index)"></i>
</div>
1. The item_striken$index instance denotes each item in the list. Here, the index refers to the index of the array. This is the index that we passed to delete the function earlier.
2. The ng-show directive shows or hides the element based on the given condition. The value of the item_striken$index instance changes on click. Based on true or false, tick or cross is displayed.
3. In span, the ng-class=”{striken : item_striken$index}” statement will add the striken class to span, if item_striken$index is false.

Both 1 and 2
Both 2 and 3
Both 1 and 3
All 1, 2, and 3

Which of the following directives removes or recreates elements of the DOM tree?

ngShow
ngHide
ngIf
ngInit

In AngularJS, which of the following steps is mandatory to enable routing in your application? Also, you have to check whether these syntaxes are valid or not.
1. Include the AngularJS Route module:

<script src="https://ajax.googleapis.com/ajax/libs/1.6.9/angular-route.js"></script>
2. Add the ngRoute as a dependency in the application module:
var app = angular.module("myApp", ["ngRoute"]);

Both 1 and 2
The syntaxes of both the steps are not valid.

Both 1 and 2
The syntax of only the second statement is valid.

Both 1 and 2
The syntax of only the first statement is valid.

Neither 1 nor 2
The syntaxes of both the steps are not valid.

Which of the following is NOT a correct ability added by the Factory recipe?

Service initialization
Fast initialization
Ability to use other services (have dependencies)

This question is based on the graphic shown below.
Consider the AngularJS code given in Figure 1 of the image. Which of the following should replace the "??" symbol shown in the script tag so as to obtain the output shown in Figure 2?

angular.module("app1", [])
.controller($scope, function(xyz) {
$scope.myForm = {};
$scope.myForm.firstName = "Kevin";
$scope.myForm.lastName = "O'Brian";
} );

angular.module("app1", [])
.xyz($scope, function(xyz) {
$scope.myForm = {};
$scope.myForm.firstName = "Kevin";
$scope.myForm.lastName = "O'Brian";
} );

angular.module("app1", [])
.xyz("xyz", function($scope) {
$scope.myForm.firstName = "Kevin";
$scope.myForm.lastName = "O'Brian";
} );

angular.module("app1", [])
.controller("xyz", function($scope) {
$scope.myForm = {};
$scope.myForm.firstName = "Kevin";
$scope.myForm.lastName = "O'Brian";
} );

It is given that the command, var app = angular.module('MyMainApp', ['module1', 'module2']), was used to inject certain modules as a dependency to the main module. These ng-app modules were developed for a web page.
What will be the result of this inclusion?

It will expose only the controllers of the dependency to the MyMainApp scope.
It will expose only the directives of the dependency to the MyMainApp scope.
It will expose both the controllers and directives of the dependency to the MyMainApp scope.
It won't expose anything to the MyMainApp scope. It will be bounded to the dependency itself.

Which of the following can be used to add/remove HTML elements from the DOM, based on the data in the model?

ng-switch directive
ng-repeat directive
ng-if directive
ng-include directive

In AngularJS, what is the function of the scope object that is available in the MVC pattern?

It initializes a method to the scope of a function in the application.
It binds the values of a method to another function that is present outside its scope.
It links a function that is present outside its scope.
It detects and broadcasts changes to the state of an application.

In the hierarchy of scope with the parent being at one level higher than the children, which of the following types of scope occupies the highest level?

Master Scope
Root Scope
Directive Scope
Controller Scope

Which directive is used to define the variables to be used in an AngularJS application?

ng-init
ng-app
ng-model
ng-bind

At which priority level does the ngIf directive execute?

Priority level 0
Priority level 10
Priority level 600
Priority level 1000

In Service Fabric, which of the following statements about the guest executable are correct?
1. It is an existing, arbitrary executable that can be run as a service in an application.
2. It is used to call the Service Fabric SDK APIs directly.
3. It contains the lifecycle support during the whole application.

Both statements 1 and 2 are correct.
Both statements 2 and 3 are correct.
Both statements 1 and 3 are correct.
All statements 1, 2, and 3 are correct.

AngularJS Fiverr Тест 2020