-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for the new Angular Control Flow syntax #2219
Comments
This issue deserves more attention, imo, because currently it's a pain to read such code while also no desire to return to the old syntax. @for (item of items; track item.id) {
<p>{{ item.name }}
} @empty {
<p>[No items.]</p>
} |
There is an ongoing PR regarding this issue, so it's definitely work in progress. |
@gergely-gyorgy-both , great, thanks 😄 just wanted to bump the issue up a bit by commenting here. |
@gergely-gyorgy-both Thank you! Really looking forward to it, can't wait 🙏 |
Excited to see this! |
Any updates on this? The alternative is use Prettier which in my opinion is terrible and I tend to avoid it at all costs. |
* Format index.html * Fix package.json files config * Ignore Pythong .eggs directory * update strings for move from beautify-web to beautifier org * Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Update codemirror and other web page depenedencies (#2234) * Fixed #2219 - formatting of new Angular control flow syntax (#2221) * Fixed #2219 - formatting of new Angular control flow syntax * Add 'angular' templating option; use it for html beautifier control flow syntax * Add more precise selection for angular control flow close tag * Print angular control flow tokens with basic formatting * Add tests for fixing issue #2219 * Change angular control flow selection to do via pattern * Fix selecting control flow closing brace if it is not preceded by whitespace * Fix regex for control flow start pattern; only select control flow open if indent_handlebars is true * Changing angular at-string detection regex Limiting this to a smaller set. --------- Co-authored-by: Liam Newman <[email protected]> * Update Changelog * Bump version numbers for 1.15.0 * Release: 1.15.0 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Liam Newman <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: gergely-gyorgy-both <[email protected]> Co-authored-by: GitHub Action <[email protected]>
@thaoula @bitwiseman FYI this change seems to have possibly unintended consequences. I use js-beautify to beautify MJML output. With the new release the output changed, see here: Before:
After: <style type="text/css">
- @media only screen and (min-width:480px) {
- .mj-column-per-100 {
- width: 100% !important;
- max-width: 100%;
- }
+ @media only screen and (min-width:480px) {
+ .mj-column-per-100
+ {
+ width:100%
+ !important;
+ max-width:
+ 100%;
+ }
}
</style> Settings used with
|
Thanks for the heads up! Hm, strange. I would expect the css beautifier to handle the style tag contents. If I can resolve it today, I'll roll back. |
This is quite strange. Sorry for the inconvenience, @bitwiseman please notify me if you need any help fixing this. |
@gergely-gyorgy-both |
microsoft/vscode-html-languageservice#177 is the last step needed in getting this made available in VS Code. |
Description
Hi Team,
The Angular team recently introduced a new Control Flow syntax for templates - https://angular.dev/guide/templates/control-flow
The new control flow syntax provides the following elements - If, else, switch and for loops. These are alternatives to *ngIf, *ngFor and *ngSwitch.
Below is some examples of the control flow syntax and expected output-
Input
With this new feature, when I give like this input:
Expected Output
I'd like to see this output:
Environment
OS: Mac
The text was updated successfully, but these errors were encountered: