Angular - Local variables and the new block syntax

I'm Nhan. I'm a web developer from Vietnam. I have over 5 years of experience in the Angular framework.

In this example, we store the data we get from a subscription in the user variable:

You might want to use the new control flow syntax of Angular 17. It is possible to use local variables as well using the following syntax:

The only difference is the ; in the middle of the expression.
I hope you found it useful. Thanks for reading. 🙏
Let's get connected! You can find me on:
Hashnode: https://nhannguyen.hashnode.dev/
X (formerly Twitter): https://twitter.com/nhannguyendevjs/