Closed not-my-profile closed 2 weeks ago
This is a well-known problem of Angular's parser infrastructure. You need to enable preserveWhitespaces
for proper source spans.
const template = parseTemplate(html, 'fake url', {
preserveWhitespaces: true,
});
Ideally this wouldn't be the case, as we currently have to work around this problem in the compiler as well:
Closing as the Angular compiler isn't really public API and there's a workaround for anyone using the private API to parse templates.
Which @angular/* package(s) are the source of the bug?
compiler
Description
Prints the following:
As you can see the
sourceSpan
of the secondBindingPipe
is incorrect. Inserting more spaces between the two interpolations makes the spans even more off.Please provide the environment you discovered this bug in (run
ng version
)Observed with @angular/compiler 17.3.7.