Template Syntax
Interpolation
{{ }}
- Text between element tags
- Attribute assignments
- Template expression - no side effect
- Can be used to assign properties - but only with string values
Property Binding
[]
- Template expression - no side effect
- Expression context:
- Template input variables
let var
- Template reference variables
#var
Class, Style & Attribute Binding
[class.foo]="true"
[style.width]="100px"
[attr.aria-label]="getAriaLabel()"
Event Binding
()
- Template statement - has side effect
(event)="statement" to the right of =