You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,3 +277,49 @@ PA: use formErrors
277
277
278
278
A: verifying some field using some asynchronous call (perhaps a server call)... return a `Promise<ValidationResult>` from your validator. When creating a FormControl object, you can pass an asynchronous validator into the constructor (e.g. `new FormControl(‘value’, syncValidator, asyncValidator)`).
279
279
280
+
281
+
## Architecture Questions:
282
+
283
+
**What is a good use case for ngrx/store?**
284
+
285
+
A: complex application state management requirements, involving asynchronous requests to update state...
286
+
287
+
**What would be a good use case for having your own routing module?**
288
+
289
+
A: An application whose requirements imply having many routes, and potentially route guards, and child routes.
290
+
291
+
## API Questions:
292
+
293
+
**What does this line do?**
294
+
`@HostBinding('[class.valid]') isValid;`
295
+
296
+
A: Applies the css class ‘valid’ to whatever is using this directive conditionally based on the value of isValid.
297
+
298
+
**Why would you use renderer methods instead of using native element methods?**
299
+
300
+
A: Potentially if you’re rendering to something besides the browser, e.g. rendering native elements on a mobile device, or server side rendering (?).
301
+
302
+
**What is the point of calling renderer.invokeElementMethod(rendererEl, methodName)?**
303
+
304
+
A: To invoke a method on a particular element but avoid direct DOM access (so we don’t tie our code just to the browser).
305
+
306
+
**How would you control size of an element on resize of the window in a component?**
307
+
308
+
A:
309
+
`@HostListener('window:resize', ['$event'])
310
+
onResize(event: any) {
311
+
this.calculateBodyHeight();
312
+
}`
313
+
314
+
**What would be a good use for NgZone service?**
315
+
316
+
A: Running an asynchronous process outside of Angular (?)
317
+
318
+
**How would you protect a component being activated through the router?**
319
+
320
+
A: Route Guards
321
+
322
+
**How would you insert an embedded view from a prepared TemplateRef?**
0 commit comments