You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Literal Array trailing comma in expressions causes error #20773
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Both are valid Typescript. Since Typescript 2.9 traling commas are not allowed, but only on rest parameters (see breaking changes description and related fix).
Both should compile without errors, so I guess this is a bug with the way Angular compiles the templates, right?
Activity
mgol commentedon Feb 22, 2018
It's not just
*ngIfbut any expression, e.g. an event handler.Note that it works in AngularJS.
[-]Array trailing comma in *ngIf condition causes error[/-]eddybrando commentedon Apr 4, 2019
It's even not just arrays, but also objects.
The following returns a syntax error when parsing the template during
ng serve:This is compiled without errors, tho:
Both are valid Typescript. Since Typescript 2.9 traling commas are not allowed, but only on rest parameters (see breaking changes description and related fix).
Both should compile without errors, so I guess this is a bug with the way Angular compiles the templates, right?
eddybrando commentedon Apr 4, 2019
@mhevery, I believe this is wrongly tagged as "feature" instead of "bug/fix" for the reasons exposed above.
feat(compiler): allow trailing comma in array literal (#22277)
angular-automatic-lock-bot commentedon Jan 2, 2021
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.