DEV Community

Nhan Nguyen
Nhan Nguyen

Posted on

1

Angular - Local variables and the new block syntax

Image description

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

Image description

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:

Image description

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:

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay