ngsp is not working properly with control flow syntax #55791
Labels
area: compiler
Issues related to `ngc`, Angular's template compiler
core: control flow
Issues related to the built-in control flow (@if, @for, @switch)
Milestone
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
The following template uses
*ngIf
and generates 2 span elements with a space between them:This results in
<span>Hello</span> <span>World</span>
, which is expectedWhen running the control flow migration, we end up with this template:
which results in this HTML, with no space:
<span>Hello</span><span>World</span>
.It looks like the
&ngsp;
is ignored by the control-flow syntax.Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-hzrodb?file=src%2Fmain.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
Note that moving the
&ngsp;
inside the@if
does work:The text was updated successfully, but these errors were encountered: