bug(language-service) using ngForTemplate (sugarized) with inline-template will mess-up html lint/format
See original GitHub issue🐞 bug report
Affected Package
?language service?
(I hope its the right repo to put this)
Is this a regression?
I think: no, not 100% sure
Description
Steps to reproduce:
- copy this into *.ts in vscode
@Component({
selector: 'my-app',
template: `
<ng-container *ngFor="let el of [1,2,3,4]; template: myTpl">
</ng-container>
<ng-template let-el #myTpl>
<p> {{el}} </p>
</ng-template>
<hr>
<ng-template ngFor let-item="$implicit" [ngForOf]="[11,22,33,44]" [ngForTemplate]="myTpl"></ng-template>
`,
styleUrls: [ './app.component.css' ]
})
export class AppComponent {}
(Stackblitz does not use language feature in inline tpl)
-
When I use this in vscode its messes up the HTML linting/ styling.
🔥 Exception or Error
Messed up html
what it should look like (ignore red error line. There is no templateLOL input)
🌍 Your Environment
- vscode Version:
1.45.1
- Angular Language Service angular.ng-template
0.901.9
Angular Version:
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.901.6
@angular-devkit/build-angular 0.901.6
@angular-devkit/build-ng-packagr 0.901.7
@angular-devkit/build-optimizer 0.901.6
@angular-devkit/build-webpack 0.901.6
@angular-devkit/core 9.1.6
@angular-devkit/schematics 9.1.6
@angular/cdk 9.2.4
@angular/cli 9.1.6
@angular/flex-layout 9.0.0-beta.31
@angular/material 9.2.4
@ngtools/webpack 9.1.6
@schematics/angular 9.1.6
@schematics/update 0.901.6
ng-packagr 9.1.5
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
Current workaround
use of “de-sugarized” version will not mess with linting/ formating.
<ng-template ngFor let-item="$implicit" [ngForOf]="[11,22,33,44]" [ngForTemplate]="myTpl"></ng-template>
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
bug(language-service) using ngForTemplate (sugarized) with ...
bug(language-service) using ngForTemplate (sugarized) with inline-template will mess-up html lint/format #839.
Read more >Angular language service not working in vscode
In HTML there is no intellisense when using F12 to go to component. The tsconfig.json gives no errors when opened in VSCode. angular...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
my pleasure @pkozlowski-opensource
Yes, will do within the next 3 days