Components & Templates Flashcards

1
Q

Describe Interpolation

A

{{ … }}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Whats component/template duality does Angular support?

A

Template View

Controller Viewmodel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Template expression?

A

A template expression produces a value. Angular executes the expression and assigns it to a property of a binding target; the target might be a an HTML element, a component, or a directive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Are template expressions Javascript?

A

No, but they are similar.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is prohibited in template expressions?

A

assignments (=, +=, -=, …)
new
chaining expressions with ; or ,
increment and decrement operators (++ and –)
no suppor for bitwise operators | and &
new template expression operators, such as |, ?., and !

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Expression Guidelines

A

No visible side effects
Quick execution
Simplicity
Idempotence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe Template statement

A

Delete Hero

A template statement responding to an event raised by a binding target such as an element, component , or directive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Are template statements equal to template statements?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is allowed and not allowed in template statements?

A

Allowed:
Basic assignment =
Chaining expressions ; or ,

Not Allowed:
new
increment and decrement operators ++ and --
operator assignment, such as += and -=
the bitwise operators | and &
the template expression operators
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What data binding directions are there?

A

source-to-view (one way)
view-to-source (one way)
view-to-source-to-view (two way)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Syntax and type for source-to-view data bindings

A

Syntax:
{{expression}}
[target]=”expression”
bind-target=”expression”

Type:
Interpolation
Property
Attribute
Class
Style
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Syntax and type for view-to-source data bindings

A

Syntax:
(target)=”statement”
on-target=”statement”

Type:
Event

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Syntax and type for view-to-source-to-view data bindings

A

Syntax:
[(target)]=”expressions”
bindon-target=”expression”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When do you use attribute binding?

A

You must use attribute binding when there is no element property to bind.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Give an example of an attribute binding!

A

Hello World!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Give an example of class binding!

A

<div>{{var}}</div>

17
Q

Give an example of style binding!

A

<div>{{colorVar}}</div>

18
Q

Give an example of an event binding!

A

Save