Deck 2: AngularJS: Functions, Directives, and Events
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/24
Play
Full screen (f)
Deck 2: AngularJS: Functions, Directives, and Events
1
Which angular function is used to wrap a raw DOM element or HTML string as a jQuery element?
A)angular.element
B)angular.bootstrap
C)none
D)all
A)angular.element
B)angular.bootstrap
C)none
D)all
angular.element
2
Can '$scope' be injected while creating service using 'factory' method?
A)Yes
B)No
C)none
D)all
A)Yes
B)No
C)none
D)all
No
3
AngularJS needs data in JSON format to populate its model.
A)true
B)false
C)none
D)all
A)true
B)false
C)none
D)all
true
4
Scope act as glue between controller and view.
A)true
B)false
C)none
D)all
A)true
B)false
C)none
D)all
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
5
AngularJS 1.0 was released in 2013.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
6
AngularJS applications are a mix of . . . . . .
A)HTML and PHP
B)HTML and CrossScript
C)HTML and AngularScript
D)HTML and JavaScript
A)HTML and PHP
B)HTML and CrossScript
C)HTML and AngularScript
D)HTML and JavaScript
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
7
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.
A)ng-app
B)ag-app
C)js-app
D)aj-app
A)ng-app
B)ag-app
C)js-app
D)aj-app
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
8
There is a controller which takes single parameter. We call it . . . . . parameter.
A)$param
B)$control
C)$scope
D)$scont
A)$param
B)$control
C)$scope
D)$scont
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
9
The . . . . . . directive is one of the most fundamental directives in AngujarJS. The . . . . . directive inserts the result of an expression into the HTML template.
A)Debug
B)Interpolation
C)Matching
D)Controller
A)Debug
B)Interpolation
C)Matching
D)Controller
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
10
First the HTML document is loaded into the browser, and evaluated by the browser. At this time the AngularJS . . . . . . .
A)JavaScript file is loaded,
B)the angular global object is created,
C)your JavaScript which registers controller functions is executed,
D)all of above
A)JavaScript file is loaded,
B)the angular global object is created,
C)your JavaScript which registers controller functions is executed,
D)all of above
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
11
You cannot use AngularJS directives to tell AnguluarJS how to mix the data into the HTML template.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
12
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 . . . .
A)SQL injection attacks
B)JS injection attacks
C)HTML injection attacks
D)Python injection attacks
A)SQL injection attacks
B)JS injection attacks
C)HTML injection attacks
D)Python injection attacks
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
13
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.
A)ng-shown, ng-hidden
B)ng-show, ng-hide
C)nt-show, nt-hide
D)ng-shows, ng-hides
A)ng-shown, ng-hidden
B)ng-show, ng-hide
C)nt-show, nt-hide
D)ng-shows, ng-hides
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
14
The . . . . . directive is used if you want to add or remove HTML elements from the DOM based on data in the model.
A)ng-switch
B)ng-model
C)ng-Disabled
D)ng-Cloak
A)ng-switch
B)ng-model
C)ng-Disabled
D)ng-Cloak
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
15
Event binding can be defined . . . . . . . . .
A)by wrapping the event in (parenthesis)
B)by prefixing it with in
C)by wrapping the event in {curly brackets}
D)by prefixing it with on
A)by wrapping the event in (parenthesis)
B)by prefixing it with in
C)by wrapping the event in {curly brackets}
D)by prefixing it with on
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
16
EventEmitter class acts both as an observer and observable.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
17
Events in Angular 2 behave like normal DOM events. They can bubble up but cannot propagate down.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
18
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.
A)exit()
B)superscript()
C)subscribe()
D)emit()
A)exit()
B)superscript()
C)subscribe()
D)emit()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
19
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 . . . . . . .
A)@Input()
B)@Get()
C)@Output()
D)@Set()
A)@Input()
B)@Get()
C)@Output()
D)@Set()
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
20
EventEmitter class is used by directives and components to emit custom Events.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
21
@Output() myEvent = new EventEmitter();
A)Declares an output property that fires events that you cannot subscribe to with an event binding.
B)Declares an output property that fires events that you can subscribe to with an event binding.
C)Declares an output property that overrides events that you can subscribe to with an event binding.
D)Declares an output property that subscribes events that you can subscribe to with an event binding.
A)Declares an output property that fires events that you cannot subscribe to with an event binding.
B)Declares an output property that fires events that you can subscribe to with an event binding.
C)Declares an output property that overrides events that you can subscribe to with an event binding.
D)Declares an output property that subscribes events that you can subscribe to with an event binding.
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
22
. . . . . . . . need to be passed as a parameter in the event callback from the template to capture the event object.
A)$event.start
B)$events
C)$eventobj
D)$event
A)$event.start
B)$events
C)$eventobj
D)$event
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
23
Calling . . . . . . . . on the event prevents propagation.
A)stopEventPropagation
B)preventEventPropagation
C)stopPropagation
D)preventPropagation
A)stopEventPropagation
B)preventEventPropagation
C)stopPropagation
D)preventPropagation
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck
24
Events on child elements are propagated upwards, and hence event binding is also possible on a parent element.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 24 flashcards in this deck.
Unlock Deck
k this deck