Skip to main content

Command Palette

Search for a command to run...

Angular - Local variables and the new block syntax

Published
1 min read
Angular - Local variables and the new block syntax
N

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:

More from this blog

Nhan Nguyen's blog

88 posts

I’m a web developer, and I am really passionate about learning web development.