Quiznetik

Angular-JS | Set 1

1. AngularJS is a library?

Correct : B. False

2. Who is sometimes called as Father of AngularJS?

Correct : C. Misko Hevery

3. Which of the following is true about ng-init directive?

Correct : C. Both of the above.

4. Which of the following directive is used to initialize an angular app?

Correct : B. ng-app

5. ng-app directive defines and links an AngularJS application to HTML.

Correct : B. true

6. AngularJS supports two-way data binding?

Correct : A. True

7. AngularJS expressions are written using.

Correct : A. double braces like {{ expression}}

8. AngularJS is an MVC based framework?

Correct : A. True

9. AngularJS bootstraps itself during config phase.

Correct : A. true

10. Angular initializes based upon which of the following scenario?

Correct : C. Both of the above

11. An Angular application can be initialized on ______?

Correct : B. ANY element

12. Can an HTML page have multiple “ng-app” directive for bootstrapping multiple AngularJS application?

Correct : B. No

13. With more than one ng-app in an HTML document (an HTML page), are all of them automatically initialized?

Correct : C. No, only one app is automatically initialized. Others have to manually initialized.

14. Can angular applications (ng-app) be nested within each other?

Correct : B. No

15. What are various possible prefixes such as 'ng-' using which Angular directives (for example, ng-app) can be defined?

Correct : C. 'ng-', 'data-ng-', 'ng:', 'x-ng-'

16. What are various possible ways in which angular application can be initialized?

Correct : C. Both of the above

17. filter filter is applied to an expression using pipe character.

Correct : A. true

18. What angular function is used to manually start up an angular application?

Correct : A. angular.bootstrap

19. Which components can be injected as a dependency in AngularJS?

Correct : A. Application Module

20. Can multiple angular applications be bootstrapped using same element??

Correct : B. No. An error is thrown such as 'App Already Bootstrapped with this Element'

21. At framework level, how does Angular retrieve the matching elements for processing?

Correct : C. Both of the above

22. Directives can be applied to which all element type?

Correct : D. All of the above

23. angular.module is primarily used to create application module.

Correct : A. true

24. Which API need to be invoked on the rootScope service to get the child scopes?

Correct : B. $new

25. Which angular module is loaded by default?

Correct : A. ng

26. Which angular function is used to wrap a raw DOM element or HTML string as a jQuery element?

Correct : A. angular.element

27. Can '$scope' be injected while creating service using 'factory' method?

Correct : B. No

28. AngularJS needs data in JSON format to populate its model.

Correct : A. true

29. Scope act as glue between controller and view.

Correct : A. true

30. AngularJS 1.0 was released in 2013.

Correct : B. False

31. AngularJS is based on the . . . . . . pattern.

Correct : B. MVC

32. AngularJS applications are a mix of . . . . . .

Correct : D. HTML and JavaScript

33. We need to tell AngularJS what part of our HTML page contains the AngularJS app. You do so by adding the . . . . attribute to the root HTML element of the AngularJS app.

Correct : A. ng-app

34. There is a controller which takes single parameter. We call it . . . . . parameter.

Correct : C. $scope

35. The . . . . . . directive is one of the most fundamental directives in AngujarJS. The . . . . . directive inserts the result of an expression into the HTML template.

Correct : D. Controller

36. First the HTML document is loaded into the browser, and evaluated by the browser. At this time the AngularJS . . . . . . .

Correct : D. all of above

37. You cannot use AngularJS directives to tell AnguluarJS how to mix the data into the HTML template.

Correct : B. False

38. If the data obtained from the model contains HTML elements, these are escaped before being inserted into the HTML template. The escaping means that the HTML is displayed as text, and not as HTML. This is done to prevent . . . .

Correct : C. HTML injection attacks

39. AngularJS can show or hide HTML depending on the state of data in the model. You do so using a set of AngularJS directives such as . . . . . . which are created specifically for that purpose.

Correct : B. ng-show, ng-hide

40. The . . . . . directive is used if you want to add or remove HTML elements from the DOM based on data in the model.

Correct : A. ng-switch

41. Event binding can be defined . . . . . . . . .

Correct : A. by wrapping the event in (parenthesis)

42. EventEmitter class acts both as an observer and observable.

Correct : A. True

43. Events in Angular 2 behave like normal DOM events. They can bubble up but cannot propagate down.

Correct : B. False

44. EventEmitter class’s simple interface, which basically encompass two methods . . . . . . . . . can therefore be used to trigger custom events and listen to events as well, both synchronously or asynchronously.

Correct : C. subscribe()

45. Angular framework provides event binding using in-built event as well as custom event. Custom events are the EventEmitter instances. To create a custom event we need to create an instance of EventEmitter annotated by . . . . . . .

Correct : A. @Input()

46. EventEmitter class is used by directives and components to emit custom Events.

Correct : A. True

47. @Output() myEvent = new EventEmitter();

Correct : D. Declares an output property that subscribes events that you can subscribe to with an event binding.

48. . . . . . . . . need to be passed as a parameter in the event callback from the template to capture the event object.

Correct : D. $event

49. Calling . . . . . . . . on the event prevents propagation.

Correct : C. stopPropagation

50. Events on child elements are propagated upwards, and hence event binding is also possible on a parent element.

Correct : A. True

51. Angular 2 is a cross platform framework.

Correct : A. True

52. Angular 2 is entirely component based. Controllers and $scope are no longer used. They have been replaced by . . . . . . . and . . . . . . . .

Correct : C. components, directives

53. Angular 2 still does not provide nested components.

Correct : B. False

54. Angular 2 components can be described using . . . . . . A . . . . . . is a way to do some meta-programming.

Correct : D. decorators, decorator

55. Angular 2 uses . . . . . . . . syntax for built-in directives.

Correct : C. Camel case

56. You can use languages like . . . . . . . . . to write Angular 2 code.

Correct : A. ES5

57. The . . . . . . . . . . directive substitutes the normal href property and makes it easier to work with route links in Angular 2.

Correct : A. RouterLink

58. There are two ways to build forms in Angular 2, namely . . . . and . . . . . .

Correct : B. model-driven

59. Angular 2 is an open source JavaScript framework to build web applications in HTML and JavaScript and has been conceived as a . . . . . . . . .

Correct : A. mobile first approach

60. Angular 1 core concept was $scope, and you will not find $scope in angular 2.0. Angular 2 is using . . . . . . . . to detect changes.

Correct : C. zone.js

61. Angular 2 integrates easily with NativeScript, allowing you to code your native app in a . . . . . . . . . style that can run on any mobile device platform.

Correct : A. declarative

62. Angular 2 make use of the . . . . . . . module syntax.

Correct : D. ES2015

63. In Angular 2, applications rely upon the . . . . . . . method to load top-level components

Correct : B. bootstrap

64. In Angular 2.0, the template compilation process is . . . . . . .

Correct : B. asynchronous

65. On the opposite side of event bindings (()) lie Angular's square-bracket syntax ([]) which signify a . . . . . .

Correct : A. property binding

66. Angular 2.0 contains a logging service called . . . . . which is very useful feature measuring where time is spent in your application.

Correct : C. diary.js

67. The router in Angular 2.0 has been reworked to be simple, yet extensible. It will include the following basic features:

Correct : A. Simple JSON-based Route Config

68. Angular 2 has a . . . . . . . service that allows us to dynamically load a component in a certain position on the page.

Correct : D. DynamicComponentLoader

69. Angular 2 can detect when component data changes, and then automatically re-render the view to reflect that change.

Correct : A. True

70. AngularJS supports . . . . . kind(s) of data binding.

Correct : B. two

71. AngularJS never regenerates the HTML again.

Correct : A. True

72. AngularJS bindings are . . . . . , meaning that when the value associated with the binding is changed (in the data model), the HTML element will be updated.

Correct : D. live

73. You can use the . . . . . . directive, in order to bind the innerHTML of the element to the specified model property.

Correct : A. ng-bind

74. Any change to the . . . . and . . . . . properties affects these bindings and consequently the user interface content.

Correct : C. noOfTries, deviation

75. In two-way binding, changes done to a model are reflected in the view, but the reverse also holds true sometimes.

Correct : B. False

76. You can create bindings only for the data values that are added to the . . . . . object by the controller.

Correct : C. $scope

77. The ng-bind directive . . . . . . allow you to hide your template markup when the HTML content is shown to the user before it is processed by AngularJS.

Correct : A. does

78. The drawback of inline bindings is that AngularJS will not find and process every set of {{ and }} characters in your content.

Correct : B. False

79. When adding . . . . . and . . . . . . to a view, we are essentially instructing Angular to create data bindings that keep the model and view in sync.

Correct : C. directives, interpolation

80. The . . . . . directive is used if you want to add or remove HTML elements from the DOM based on data in the model.

Correct : A. ng-switch

81. AngularJS is based on the _____ pattern

Correct : B. MVC

82. What is Angular Js?

Correct : B. Framework

83. AngularJS applications are a mix of _____

Correct : C. HTML and AngularScript

84. How to include HTML content into another HTML?

Correct : D. Use of include

85. What is MVC (Mode View Controller)?

Correct : C. It is a software design pattern for developing web applications

86. Which of the following is true about AngularJS service?

Correct : D. All of the above

87. Which of the following is valid for AngualarJS module

Correct : D. var app = angular.module("myApp");

88. What angular function is used to manually start up an angular application ?

Correct : A. angular.bootstrap

89. Which of the following is true about

Correct : C. All of these

90. Which is the right format for calling a ng-bind function?

Correct : D. All the Above

91. What is the purpose of angular.module in AngularJS?

Correct : A. It creates an application module

92. What are various possible ways in which angular application can be initialized?

Correct : C. Both of the above

93. AngularJS controllers control ___of AngularJS applications.

Correct : A. the data

94. Which directive defines the application controller?

Correct : C. ng-controller

95. Whichdirectives bind the input fields to the controller properties?

Correct : A. data-ng-model

96. In larger applications,controllers are stored in ___?

Correct : A. external files

97. Which statement is true about scope in AngularJS?

Correct : D. All of the above

98. Controller, which is the JavaScript function that ___ the data?

Correct : D. All of the above

99. $rootScoperefers to an object which is accessible from everywhereof theapplication.

Correct : A. True

100. $rootScope is created with ___

Correct : B. ng-app