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
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,19 +14,46 @@ PA: Using the transition and animate function in an animations block like so: `a
14
14
A: Using the asterisk - example: `transition('* => active'), animate('100ms ease-in'))`
15
15
16
16
## Template Syntax Questions
17
+
17
18
**What is a template reference variable, and how would you use it?**
19
+
18
20
A: A variable (defined using a #) in a component template, which can be referenced in other parts of the template. For example, a template variable for a form can then be referenced by other elements of the form.
19
21
20
22
**What are the possible ways to bind component properties to an associated template?**
23
+
21
24
A: interpolation binding, one way binding, two way binding.
22
25
23
26
## Component/Directive Questions
27
+
24
28
**What is the minimum definition of a component?**
29
+
25
30
A: A class with a Component decorator specifying a template.
26
31
27
32
**What is the difference between a component and a template?**
33
+
28
34
A: A component is a directive with a template (representing a view).
29
35
30
36
**What are different kinds of directives supported in Angular 2?**
37
+
31
38
A: Structural, directive, component, and attribute directives.
32
39
40
+
**How do components communicate with each other?**
41
+
42
+
A: Various ways - for example: Input/Output properties, services, ViewChild/ViewContent...
43
+
44
+
**How do you create two way data binding in Angular 2.0?**
45
+
46
+
Answer: By using the two-way binding syntax [()] along with ngModel...
47
+
48
+
**How would you create a component to display error messages throughout your application?**
49
+
50
+
A: Set up an ErrorHandler... TODO
51
+
52
+
**How would you support logging in your Angular app?**
53
+
54
+
PA: Set up angular2-logger, which is a package inspired by log4j.
55
+
56
+
**How do you resolve a template URL relative to a Component class?**
57
+
58
+
A: By specifying the moduleId to be module.id in the Component decorator. (Note: while this is still needed when using SystemJS, it is not necessary anymore when using Webpack module bundler for Angular 2 projects.)
0 commit comments