-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathangular.html
More file actions
146 lines (146 loc) · 7.54 KB
/
angular.html
File metadata and controls
146 lines (146 loc) · 7.54 KB
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
<!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>angular</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-decorator-lets-a-child-component-expose-an-event-to-a-parent-component">1. Which decorator lets a child component expose an event to a parent component?</h4>
<ul>
<li>[] <span class="citation" data-cites="Raise">@Raise</span></li>
<li>[] <span class="citation" data-cites="Event">@Event</span></li>
<li>[✅] <span class="citation" data-cites="0utput">@0utput</span></li>
<li>[] <span class="citation" data-cites="EventEmitter">@EventEmitter</span></li>
</ul>
<h4 id="what-is-the-meaning-of-the-return-type-of-this-function-getheroid-number-observable">2. What is the meaning of the return type of this function: getHero(id: number): Observable<Hero> { }?</h4>
<ul>
<li>[] It returns a Hero object with an associated Observable property</li>
<li>[] It returns an Observable that emits an item of type Hero</li>
<li>[] It returns an observable created by passing in a hero object</li>
<li>[✅] it returns an observable that can be mapped to an item of type hero</li>
</ul>
<h4 id="what-is-the-purpose-of-reactive-extensions-rxjs-in-an-angular-application">3. What is the purpose of Reactive Extensions (RxJS) in an Angular application?</h4>
<ul>
<li>[] React to end-user changes and automatically display appropriate validation messages</li>
<li>[] create and manipulate streams of events and data using observable sequences and fluent query operators</li>
<li>[✅] React to the form factor and orientation of the device and automatically adjust the display for optimum viewing</li>
<li>[] Define a build pipeline that reacts to code changes and deploys the application to production</li>
</ul>
<h4 id="which-is-the-correct-syntax-for-two-way-data-binding">4. Which is the correct syntax for two-way data binding?</h4>
<ul>
<li>[] <input ngModel=“LastName’ />”</li>
<li>[✅] <input [ngModel]=“LastName’ />”</li>
<li>[] <input [(ngModel)]=“LastName />”</li>
<li>[] <input ([ngModel])=“LastName />”</li>
</ul>
<h4 id="which-of-the-following-will-result-in-the-style-classes-main-and-tall-being-added-to-the-dom-node">5. Which of the following will result in the style classes “main” and “tall” being added to the DOM node?</h4>
<ul>
<li>[✅] [ngClass]=“’main tall”</li>
<li>[] [ngClass]=“’main + tall”</li>
<li>[] [ngClass]="‘main : tall’</li>
<li>[] [ngClass]=“‘main && tall’”</li>
</ul>
<h4 id="what-angular-cli-command-should-you-run-in-your-cl-server-before-deploying-your-angular-app">6. What Angular CLI command should you run in your Cl server before deploying your Angular app?</h4>
<ul>
<li>[✅] ngbuild</li>
<li>[] ng prod</li>
<li>[] ng build –prod</li>
<li>[] ng prod –build</li>
</ul>
<h4 id="which-character-is-used-to-prefix-a-structural-directive">7. Which character is used to prefix a structural directive?</h4>
<ul>
<li>[] -</li>
<li>[✅] *</li>
<li>[] |</li>
<li>[] #</li>
<li>[] /</li>
</ul>
<h4 id="what-is-the-default-return-value-of-the-httpclient-services-get-function">8. What is the default return value of the HttpClient services get function?</h4>
<ul>
<li>[✅] | Observable<T></li>
<li>[] static value</li>
<li>[] Promise<T></li>
<li>[] callback function</li>
</ul>
<h4 id="what-does-this-syntax-accomplish-routerlinkcrisis-center">9. What does this syntax accomplish? routerLink=“/crisis-center”?</h4>
<ul>
<li>[] The syntax links a route to a service by matching the assigned string to a service class name.</li>
<li>[] The syntax navigates to the component with a path matching the assigned string.</li>
<li>[] The syntax navigates to the component with a name matching the assigned string.</li>
<li>[✅] The syntax links a route with data by matching the assigned string to a property name</li>
</ul>
<h4 id="according-to-the-angular-style-guide-why-should-unit-test-files-be-named-the-same-as-the-feature-they-represent-but-with-a-.spec.ts-extension">10. According to the Angular Style Guide, why should unit test files be named the same as the feature they represent, but with a .spec.ts extension?</h4>
<ul>
<li>[] Keeps the file structure more organized</li>
<li>[] They shouldn’t. Instead, unit tests should be in the same file as the Angular feature</li>
<li>[✅] Helps identify which files to serve with ng serve</li>
<li>[] Provides a consistent way to identify tests with pattern matching test runners</li>
</ul>
<h4 id="which-lifecycle-hook-fires-whenever-a-change-occurs-to-any-of-the-components-input-properties">11. Which lifecycle hook fires whenever a change occurs to any of the component’s input properties?</h4>
<ul>
<li>[] ngOnDirty</li>
<li>[✅] ngOnInit</li>
<li>[] ngOnChanges</li>
<li>[] ngOnKeyPress</li>
<li>[] ngOnInput</li>
</ul>
<h4 id="what-is-the-purpose-of-the-imports-array-of-an-angular-module">12. What is the purpose of the imports array of an Angular module?</h4>
<ul>
<li>[] To define what external libraries, if any, your app needs</li>
<li>[✅] Define the set of modules whose exported components directives and pipes the templates of this module need</li>
<li>[] To define the set of services that are created and available for dependency injection</li>
<li>[] To define what information a form will capture</li>
</ul>
<h4 id="what-is-the-purpose-of-the-safe-navigation-operator">13. What is the purpose of the safe navigation operator ?</h4>
<ul>
<li>[] To ensure a route is valid before navigation to that route</li>
<li>[] To perform two-way data binding</li>
<li>[✅] To guard against null and undefined values in property paths</li>
<li>[] To ensure the user has saved data before navigating away from a route.</li>
</ul>
<h4 id="how-would-you-write-code-to-modify-the-response-from-an-http.get">14.How would you write code to modify the response from an http.get ?</h4>
<ul>
<li>[✅] Using the map function inside of the pipe operator chained to the http.get</li>
<li>[] Using the transform operator chained to the http.get</li>
<li>[] Subscribing to the http.get and setting the response to a local variable</li>
<li>[] Using the modify operator chained to the http-get</li>
</ul>
<h4 id="which-directive-allows-you-to-conditionally-remove-content-from-the-dom">15. Which directive allows you to conditionally remove content from the DOM?</h4>
<ul>
<li>[] ngRepeat</li>
<li>[] *ngif</li>
<li>[✅] nghide</li>
<li>[] *ngfor</li>
<li>[] ngshow</li>
</ul>
<h4 id="which-directive-allows-you-to-display-items-from-a-collection-of-items">16. Which directive allows you to display items from a collection of items?</h4>
<ul>
<li>[] ngFor</li>
<li>[✅] ngrepeat</li>
<li>[] ngSwitch</li>
<li>[] ngCollection</li>
</ul>
<h4 id="what-is-an-appropriate-way-to-break-up-a-large-view-into-smaller-pieces">17. What is an appropriate way to break up a large view into smaller pieces?</h4>
<ul>
<li>[✅] Pipes</li>
<li>[] Services</li>
<li>[] modules</li>
<li>[] Child Components</li>
</ul>
<h4 id="which-angular-cli-flag-will-not-generate-unit-tests-for-a-component">18. Which Angular CLI flag will NOT generate unit tests for a component?</h4>
<ul>
<li>[] –testing=false</li>
<li>[✅] –unit-test=false</li>
<li>[] –skiptests=true</li>
<li>[] –test=false</li>
</ul>
</body>
</html>