How to Fix Angular Control Flow Formatting in VS Code
If you’ve used VS Code’s “Format Document” right-click option to format an Angular HTML template, you may have noticed that it doesn’t indent things the way you’d expect. Example: In the code above, the option tag should be indented within the @for loop. There’s been a fix for this. 😊 If you edit the settings.json file in the .vscode folder, and add this, it will work: After adding this to settings.json and using the “Format Document” option, it formats correctly.