-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathangularjs.html
152 lines (152 loc) · 6.45 KB
/
angularjs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>angularjs</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
</head>
<body>
<h4 id="which-of-these-is-an-example-of-an-element-directive">1 Which of these is an example of an element directive?</h4>
<ul>
<li>[ ] <code><div ng-show="false"></div></code></li>
<li>[ ] <code><div ng-app="app"></div></code></li>
<li>[ ] <code><div ng-element="my-directive"></div></code></li>
<li>[✅] <code><my-directive ></my-directive></code></li>
</ul>
<h4 id="what-does-the-ngcsp-directive-do">2 What does the ngCsp directive do?</h4>
<ul>
<li>[ ] Disables Content ecurity Policy support</li>
<li>[ ] It is not a valid directive</li>
<li>[✅] Enables Content ecurity Policy support</li>
<li>[ ] Detect when an element is clicked</li>
</ul>
<h4 id="where-is-the-appropriate-place-to-put-business-logic">3 Where is the appropriate place to put business logic?</h4>
<ul>
<li>[ ] A filter</li>
<li>[✅] A service</li>
<li>[ ] A directive</li>
<li>[ ] A controller</li>
</ul>
<h4 id="which-directive-do-you-use-with-routing-to-display-a-template">4 Which directive do you use with routing to display a template?</h4>
<ul>
<li>[✅] ng-view</li>
<li>[ ] ng-show</li>
<li>[ ] ng-open</li>
<li>[ ] ng-hide</li>
</ul>
<h4 id="what-is-i18n">5 What is i18n?</h4>
<ul>
<li>[ ] Data Interoperability</li>
<li>[ ] ervice Interoperability</li>
<li>[✅] Internationalization</li>
<li>[ ] Directive Interoperability</li>
</ul>
<h4 id="you-are-implementing-a-third-party-notification-library-which-is-implemented-as-a-global-object-with-a-notify-method.-what-is-the-best-way-to-use-this-library-with-angular">6 You are implementing a third-party notification library which is implemented as a global object with a notify method. What is the best way to use this library with Angular?</h4>
<ul>
<li>[ ] Use a custom resolver.</li>
<li>[✅] Wrap it in a service.</li>
<li>[ ] Make no modification, use it as is.</li>
<li>[ ] Wrap it in a custom directive.</li>
</ul>
<h4 id="which-of-the-following-classes-is-not-used-by-angular-in-form-validation">7 Which of the following classes is NOT used by Angular in form validation?</h4>
<ul>
<li>[ ] ng-submitted</li>
<li>[ ] ng-dirty</li>
<li>[ ] ng-pristine</li>
<li>[✅] ng-unsubmitted</li>
</ul>
<h4 id="which-service-allows-you-to-configure-routes">8 Which service allows you to configure routes?</h4>
<ul>
<li>[ ] $route</li>
<li>[✅] $routeProvider</li>
<li>[ ] $config</li>
<li>[ ] The angular global object</li>
</ul>
<h4 id="which-component-may-be-injected-during-the-config-phase">9 Which component may be injected during the config phase?</h4>
<ul>
<li>[✅] provider</li>
<li>[ ] factory</li>
<li>[ ] variable</li>
<li>[ ] value</li>
</ul>
<h4 id="how-can-you-share-data-between-two-different-controllers">10 How can you share data between two different controllers?</h4>
<ul>
<li>[ ] Create a custom provider</li>
<li>[ ] Use the controller property of the link function</li>
<li>[✅] Use a service</li>
<li>[ ] Use a filter</li>
</ul>
<h4 id="you-need-to-support-internet-explorer-11-google-chrome-microsoft-edge-mozilla-firefox-and-apple-afari-browsers-with-your-new-app.-how-should-you-apply-styles-to-your-elements-in-a-manner-that-is-supported-in-all-browsers">11 You need to support Internet Explorer 11, Google Chrome, Microsoft Edge, Mozilla Firefox, and Apple afari browsers with your new app. How should you apply styles to your elements in a manner that is supported in all browsers</h4>
<ul>
<li>[✅] Use ng-style on your elements</li>
<li>[ ] Use style=“{{ someCss }}” on your elements</li>
<li>[ ] Use ng-overridetyles() in your code</li>
<li>[ ] Use ng-applytyles() in your code</li>
</ul>
<h4 id="which-angular-module-can-be-used-to-parse-html-data-securely">12 Which Angular module can be used to parse HTML data securely?</h4>
<ul>
<li>[ ] ngRoute</li>
<li>[ ] ng</li>
<li>[ ] ngAnimate</li>
<li>[✅] nganitize</li>
</ul>
<h4 id="what-are-directives-used-for">13 What are directives used for?</h4>
<ul>
<li>[✅] Encapsulating functionality into custom elements</li>
<li>[ ] Managing data binding</li>
<li>[ ] Manipulating pre-built AngularJ functions</li>
<li>[ ] Creating functions on the server-side</li>
</ul>
<h4 id="which-of-the-following-creates-a-custom-filter-named-duration">14 Which of the following creates a custom filter named “duration”?</h4>
<ul>
<li>[ ]
<pre>
. filter(function(‘duration’) { // implementation });</li>
<li>[ ]
<pre>
. filter(‘durationFilter’, function() { // implementation });</li>
<li>[ ]
<pre>
. filter(‘duration-filter’, function() { // implementation });</li>
<li>[✅]
<pre>
. filter(‘duration’, function() { // implementation });</li>
</ul>
<h4 id="which-angular-feature-sets-up-the-initial-state-and-adds-behavior-to-the-scope-object">15 Which Angular feature sets up the initial state and adds behavior to the $scope object?</h4>
<ul>
<li>[ ] Service</li>
<li>[ ] Filter</li>
<li>[✅] Controller</li>
<li>[ ] Template</li>
</ul>
<h4 id="which-choice-is-equivalent-to-the-following-code">16 Which choice is equivalent to the following code?</h4>
<p>$http.get(‘/index.html’)</p>
<ul>
<li>[✅] $http({method: ‘GET’, url: ‘/index.html’})</li>
<li>[ ] $http(‘/index.html’, ‘get’)</li>
<li>[ ] $http(‘get’, ‘/index.html’)</li>
<li>[ ] $http(‘GET’, {url: ‘/index.html’})</li>
</ul>
<h4 id="what-effect-does-using-the-restrict-e-option-have-when-creating-a-custom-directive">17 What effect does using the restrict: E option have when creating a custom directive?</h4>
<ul>
<li>[ ] The directive will only be triggered by an attribute.</li>
<li>[ ] The directive will return an error if no model data is present.</li>
<li>[ ] The directive will only work in external templates.</li>
<li>[✅] The directive will only be triggered by an element.</li>
</ul>
<h4 id="which-service-contains-the-current-set-of-route-parameters">18 Which service contains the current set of route parameters?</h4>
<ul>
<li>[✅] $routeParams</li>
<li>[ ] The global angular object</li>
<li>[ ] $routeParameters</li>
<li>[ ] $locationParameters</li>
</ul>
</body>
</html>