Interpolation
Embeds component data into text using double-curly-brace syntax.
Syntax
{{ expression }} Parameters
| Name | Type | Required | Description |
|---|---|---|---|
expression | any | No | A template expression coerced to a string for display. |
Returns
string — The stringified expression inserted into the DOM.
Examples
@Component({
selector: 'app-x',
standalone: true,
template: `<p>{{ name }} is {{ 2026 - birthYear }}</p>`,
})
export class XComponent {
name = 'Ada';
birthYear = 1990;
}
Notes
Interpolation evaluates a template expression and renders the result as text;
Angular sanitizes and escapes the output. Expressions must be side-effect
free and cannot use assignments, new, or most operators. Calling signals
inside `{{ }}` makes the binding reactive.