Our team has conducted extensive research to compile a set of Angular JS MCQs. We encourage you to test your Angular JS knowledge by answering these 100+ multiple-choice questions provided below.
Simply scroll down to begin!
A. $watchCollection();
B. $destroy();
C. $apply();
D. $evalo();
A developer defines an image tag whose source is evaluated through a binding expression (<img src ='ltimageii' />)- 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.
A.
Only 2 and 3.
B.
Only 1.
C.
All of them.
D.
Only1 and 2.
A. ngShow
B. ngHide
C. nglf
D. nglnit
A. The div tag will be hidden using CSS properties.
B. The visibility of the div tag will be made 0 using CSS properties.
C. The div tag will be entirely removed from the DOM.
D. The div tag will become visible in the view.
A. ng-touched
B. ng-pending
C. ng-dirty
D. ng-pristine
A. ng-pristine
B. ng-touched
C. ng-lnvalid
D. ng-dirty
in AnguiarJS. 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:
2. Add the ngRoute as a dependency in the application module:
var app = angular.module(”myApp”, [“ngRoute"]);
A.
Both 1 and 2
The syntaxes of both the steps are not valid.
B.
Both 1 and 2
The syntax of only the second statement is valid.
C.
Both 1 and 2
The syntax of only the first statement is valid.
D.
Neither 1 nor 2
The syntaxes of both the steps are not valid.
A. jsonp([lconfig]);
B. jsonp(url, [config]);
C. jsonp(url, [config], data]);
D. jsonp( data. [config]);
A. A string, which is tie-serialized manually using json api to convert it into a json object
B. A JavaScript object. The http service will de-serialize the received json file automatically
C. A special format provided by the http service, especially for angular using the UTF-8 specification.
D. None of the above.
A. whenGET(actions, [data]. [headers]);
B. whenGEfT(url. [headersj] );
C. whenGET(uri. [headers]. [actions] );
D. whenGET(actions]. [data]. urli );
A.
(a)
B.
(b)
C.
(C)
The following AngularJS expression is used to get data from a server. Which of the given statements is correct?
var data = $http.get(uri):
A.
"data" is an http response object.
B.
The get() method in the given code returns a string containing the server response data
C.
A promise object is returned by the geto method in the given code.
D. "data" is a deferred object.
A. (())
B. {()}
C. {{}}
D. [()]
A. Master Scope
B. Root Scope
C. Directive Scope
D. Controller Scope
A. $init
B. $watch
C. $injector
D. sapply
A. Only when the input value is invalid continuously since the model will stay null.
B. Only when the model has modified programmatically and not by changing the input value.
C. Only when there is no modification in the value that is returned from the sparsers transformation pipeline.
D. Only when a modification in the input value causes a new value to be committed to the model.
A. Only factory
B. Only service
C. Both factory and service
A. Normalized, lowercase form
B. Normalized, uppercase form
C. Normalized, camelcase form
D. Normalized, propercase form
A. It is a service locator that is used to retrieve the name of the module to be created.
B. It is a function that is used to reload the current application with debug information turned on.
C. It is a service locator that is used to retrieve object instances.
D. It is a function that is used to determine the undefined reference.
A. Service initialization
B. Fast initialization
C. Ability to use other services (have dependencies)
A. The data available in different storage devices is moved to the cloud.
B. The data that occupies a large memory space is deleted.
C. The storage devices owned by the data owners can be moved next to the big data centers for fast path access to compute clusters.
D. None of the above.
A. REST API calls.
B. JSONP calls through the $http service.
C. AJAX calls through the $http service.
D. Both a and c.
E. a. b and c.
A. $index
B. $next
C. $first
D. $last
Suppose that you used the following statement to create a scope variable in AngularJS.
var p = $root$copez
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?
A.
The "inherit' parameter in the $newo function must be 'false" while creating the child.
B.
The “isolate“ parameter in the Snew() function must be "true“ while creating the child.
C.
The “isolate“ parameter in the Snew() function must be "true“ while creating the child.
D.
The child will never inherit its parent's scope.
A. $http.get()
B. [l $http.put0
C. $http.post()
D. $http.delete0
A. whenPUT(url, [headers]. [actions] ):
B. whenPUT(http method, [headers], url, [data] );
C. whenPUT(actions. [data]. [headers]);
D. whenPUT(url, [data], [headers]);
A. url
B. paramDefaults
C. Actions
D. options
A. config
B. Url
C. response
D. Promise
A. Service
B. Transport
C. Both options a and b
D. Neither option a nor b
Consider that a service called Shttp makes server calls. Which of the following examples about the dependency injection in AnguiarJS is correct?
Example 1:
function fetchDashboard Data()
[
var $http = new HttpServicel);
return Shttp.get(
A.
Both options a and b
B.
Neither option a nor b
The following snippet is used in an HTML file to insert the angular.js framework file:
"