Displaying Data Flashcards
Interpolation example
{{interpolated content}}
Interpolation example
{{interpolated content}}
How do you write multiline string
The backtick: ‘
declare a component in html
Structural direct for if statements
*ngIf=”booleanExpression; then templateForFalse
declare a component in html
Structural directive for for loops
*ngFor=”let item of items”
Structural direct for if statements
*ngIf=”booleanExpression; then templateForFalse
Declare a template reference variable to refer to element tags.
#variableName Useful Fact: takes precedence over other variables available in the template
Do templates have access to global variables such as “window” or “document”?
Nope
Rules for template expressions
No visible side effects
Quick execution
Simplicity
Idempotence
Action triggered by event raised that is binding a an element, component, or directive.
Template statement
Which can chain statements and assign values? Template expression or template statements?
Template statements
One way from source to view target binding
{{expression}}
[target]=”expression”
bind-target=”expression”
One-way
from view target
to data source
(target)=”statement”
on-target=”statement”