You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
If I declare a local template variable in an @if() block, such variable is available in the @if() block but not in the @else() block, which seems like a bug. See cartContents below is not available in my @else block (see variable name in red below):
Please provide a link to a minimal reproduction of the bug
Screenshot has an example
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
Hi, this is as designed. Have a look at the RFC. Also note that aliasing is only supported because of the backward compatibility with *ngIf. See also #52103
What you are looking for is the longly awaited template variable declaration #15280.
Ok. Now that the syntax looks like regular if—then—else blocks, my expectation was that this would behave just like in other programming languages. I guess that's one more reason to use Signals instead of Observables.
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
If I declare a local template variable in an @if() block, such variable is available in the @if() block but not in the @else() block, which seems like a bug. See
cartContents
below is not available in my @else block (see variable name in red below):Please provide a link to a minimal reproduction of the bug
Screenshot has an example
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: