Skip to content

Strings in bindings are not allowed to contain interpolation syntax #39601

Closed
@JoostK

Description

@JoostK

🐞 bug report

Affected Package

The issue is caused by package @angular/compiler

Is this a regression?

Nope

Description

A parse error occurs when interpolation syntax is used inside of a string literal in a binding: e.g. <comp [input]="'{{interpolation}}'"></comp> is valid but is rejected with an error:

Parser Error: Got interpolation ({{}}) where expression was expected at column 1 in ['{{interpolation}}'] in /~/src/app/app.component.html@0:13

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-ivy-wjcqqs?file=src%2Fapp%2Fapp.component.html

🌍 Your Environment

Angular Version:
Tested on 10.2.2 but has always been broken.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions