New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Introduce Concise Syntax for Defining Template Variables in Angular Templates #55004
Comments
Closing as a duplicate of #15280. |
@alxhub I see why you marked this as a duplicate, I will copy my suggestion to the mentioned issue. Asking the above question here to have a quick ref to my suggestion. 😅 |
@DavidWeiss2 in this case I wouldn't recommend starting with a PR. There's a lot of complexity that goes into features like this, such as design reviews, potentially user studies, considerations of how it'll interact with future projects on our roadmap like signal components, etc. Your proposal for the syntax definitely contributes to the discussion, but I would hate for you to put in a lot of effort if that doesn't end up being the direction we go in. |
Thank you for the feedback. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are relevant/related to the feature request?
compiler, core, language-service
Description
Angular's template syntax is a powerful tool for developers to create dynamic and interactive web applications. With the ongoing enhancements in Angular, such as the introduction of signals in Angular 17, the framework continues to improve both performance and developer experience. This feature request proposes adding a concise syntax for defining template variables directly within Angular templates, aiming to simplify the referencing of complex expressions, reactive states, and asynchronous data streams.
Proposed solution
The proposal is to introduce a
@define
syntax that allows developers to create aliases or shorthand notations for complex expressions directly within templates:This new syntax would bring several benefits:
Alternatives considered
async
for asynchronous data. However, this does not address the verbosity of complex expressions or improve template readability.This feature request aims to complement the existing mechanisms in Angular by providing a more integrated and intuitive way to handle complex expressions within templates, further enhancing Angular's developer experience.
The text was updated successfully, but these errors were encountered: