Guide › Templates
Attributes
Bind an attribute with [name]="expression", or put { } inside an attribute value.
<a href="/guide/{{ slug }}" [aria-current]="active ? 'page' : false">{{ label }}</a>
<button [disabled]="saving">Save</button>Values
- Values are escaped.
trueadds a boolean attribute;false,nullandundefinedremove it.- Inside an interactive component, attributes that read state update when it changes.
Safety
URL attributes such as href and src only accept relative URLs and http:, https:, mailto: and tel: (plus raster data: images for image attributes); anything else becomes about:invalid#unsafe. srcdoc can't be bound. A bound style is escaped but not checked, so don't put untrusted data in it.