google.com, pub-8658045329707802, DIRECT, f08c47fec0942fa0
Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

Showing posts with label AngularJS Test Answer 2019. Show all posts
Showing posts with label AngularJS Test Answer 2019. Show all posts

AngularJS Test Answer 2019


1. A promise is an interface that deals with objects that are __ or __ filled in at a future point in time (basically, asynchronous actions)?
Answers:
• set, data
• returned, data
• returned, set
• returned, get

2. Which of the following are methods in an instance of $q.defer() ?
Note: There may be more than one right answer.
Answers:
• finally
• when
• notify
• then
• reject
• resolve

3. Which of the following is the correct syntax for using the $q.all method?
Note: There may be more than one right answer.
Answers:
• «`
$q.all([promise1(),promise2]]).then((values) => {
});
«
• «`
$q.all(«promise1», «promise2»).then((values) => {
});
«`
• «`
$q.all({«promise1″: promise1(),»promise2»: promise2()}).then((values) => {
});
«`

4. Custom directives are used in AngularJS to extend the functionality of HTML?
Answers:
• extend
• integrate
• render
• connect
• connect

5. Explain $q service, deferred and promises, Select a correct answer?
Answers:
• Promises are post processing logics which are executed after some operation/action is completed whereas ‘deferred’ is used to control how and when those promise logics will execute.
• We can think about promises as “WHAT” we want to fire after an operation is completed while deferred controls “WHEN” and “HOW” those promises will execute.
• “$q” is the angular service which provides promises and deferred functionality.
• All of the above

6. The Promise proposal dictates the following for asynchronous requests?
Note: There may be more than one right answer.
Answers:
• The Promise has a then function, which takes two arguments, a function to handle the “resolved” or “success” event, and a function to handle the “rejected” or the “failure” event
• It is guaranteed that one of the two callbacks will be called, as soon as the result is available
• Async requests return a promise instead of a return value
• The Promise proposal is the basis for how AngularJS structures local

7. How to use AngularJS promises, read the example code?
Answers:
• controller(‘MyCtrl’, function($scope, $q) {
function longOperation() {
var q = $q.defer();
somethingLong(function() {
q.resolve();
});
return q.promise;
}
longOperation().then(function() {
});
})

• controller(‘MyCtrl’, function($scope, $q) {
var lastUrl;
var lastFileName
return {
createPdf(url, fileName){
//do processing
lastUrl = url;
lastFileName = fileName
},
loadLastPdf(){
//use lastUrl and lastFileName
}
}
})

• Both of the above
• None of the above

8. What is ng-hide directive used for?
Answers:
• Show a given control
• Hide a given control
• Both of the above
• None of the above

9. What is the output of the following code:
$scope.firstName = «John»,
$scope.lastName = «Doe»
{{ firstName | uppercase }} {{ lastName }}
Answers:
• john doe
• JOHN DOE
• John Doe
• JOHN Doe

10. Which of the following is a valid http get request in AngularJS?
Answers:
• $http.request(«someUrl»)
.then(function(response) {
$scope.content = response.data;
});
• $http({
url : «someUrl»
}).then(function succesFunction(response) {
$scope.content = response.data;
}, function errorFunction(response) {
$scope.content = response.statusText;
});
• $http({
url : “someUrl»
data : «test»
}).then(function succesFunction(response) {
$scope.content = response.data;
}, function errorFunction(response) {
$scope.content = response.statusText;
});
• $http.get(”method=get”,“someUrl”)
.then(function(response) {
$scope.content = response.data;
});

11. Which of the following directive bootstraps AngularJS framework?
Answers:
• ng-init
• ng-app
• ng-controller
• ng-bootstrap

12. AngularJS supports inbuilt internationalization following types of filters?
Note: There may be more than one right answer.
Answers:
• numbers
• date
• currency
• All of the above

13. Which of the following is validation css class in AngularJS?
Answers:
• ng-valid
• ng-invalid
• ng-pristine
• All of the above.

14. Which of the following service is used to handle uncaught exceptions in AngularJS?
Answers:
• $errorHandler
• $exception
• $log
• $exceptionHandler

15. Out of the following which statement is equivalent to
< p ng-bind=»foo «>< /p >
Answers:
• <p>{{foo}}</p>
• <p {{foo}}></p>
• <p>{{«foo»}}</p>
• <p {{«foo»}}></p>

16. Which of the following module is required for routing?
Answers:
• angular.js
• angular-route.js
• angularRouting.js
• route.js

17. Which of the following is not a type of an Angular service?
Answers:
• service
• value
• controller
• provider
• factory
• constant

18. Which of the following is not valid feature for Angular templates?
Answers:
• Routes
• Filters
• Directives
• Forms

19. Dynamically loadable DOM template fragment, called a , through a ?
Answers:
• view, model
• view, route
• view, template
• view, render

20. Which Angular service simulate the ‘console’ object methods from Javascript?
Answers:
• Http
• Log
• Interpolate
• Sce

21. What is Angular Expression, How do you differentiate between Angular expressions and JavaScript expressions?
Answers:
• Context : The expressions are evaluated against a scope object in Angular, while Javascript expressions are evaluated against the global window.
• Forgiving: In Angular expression, the evaluation is forgiving to null and undefined whereas in JavaScript undefined properties generate TypeError or ReferenceError.
• No Control Flow Statements: We cannot use loops, conditionals or exceptions in an Angular expression.
• Filters: In Angular unlike JavaScript, we can use filters to format data before displaying it.
• All of the above

22. Which of the following is true about lowercase filter?
Answers:
• Lowercase filter converts a text to lower case text.
• Lowercase filter converts the first character of the text to lower case.
• Lowercase filter converts the first character of each word in text to lower case.
• None of the above

23. Which of the following is Angular E2E testing tool?
Answers:
• JsTestDriver
• Jasmine
• Nightwatch
• Protractor

24. What is the output of the following code:
$scope.data = [1, 2, 3, 4, 5];
< span ng-repeat=»item in data» ng-if=»item > 5 && item < 10 «>{{ item }}< /span >
Answers:
• 6 7 8 9 10
• 1 2 3 4 5
• Nothing is output

25. What can be following validate data in AngularJS?
Answers:
• $dirty − states that value has been changed.
• $invalid − states that value entered is invalid.
• $error − states the exact error.
• All of the above

26. AngularJS service can be created,registered,created in following different ways?
Note: There may be more than one right answer.
Answers:
• the factory() method
• the value() method
• the service() method
• the provider() method
• None of the above

27. ng-bind directive binds ___.
Answers:
• Data to model.
• View to controller.
• Model to HTML element.
• Model to $scope.

28. What is the output of the following code?
< body ng-app=»myApp» >
< !— directive: my-directive — >
< /body>
var app = angular.module(«myApp», []);
app.directive(«myDirective», function() {
return {
replace : true,
template : «<h1>I got printed</h1>»
};
});
Answers:
• <h1 my-directive=»»>I got printed</h1>
• Blank Screen
• <h1>I got printed</h1>
• <h1 class=»my-directive»>I got printed</h1>

29. What kind of filters are supported the inbuilt internationalization in AngularJS?
Answers:
• currency and date
• currency, date and numbers
• date and numbers
• None of above