Skip to content

Angular HTML ngif - else issue #5539

@fredericouimet

Description

@fredericouimet

Prettier 1.15.1
When using the 'angular' formatter, this code:

<ng-container *ngIf="data?.title; else defaultTitle">{{ data.title | translate }}

gets reformatted this way: (notice the ":" after the "else")
<ng-container *ngIf="data?.title; else: defaultTitle">{{ data.title | translate }}

When forcing the "html" parser for *.component.html files, this does not happen.

Expected behavior:
no ":" gets added after the "else", as this is not a valid angular template syntax.

Thank you!
Frederic

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:angularIssues affecting Angular template (not general JS/TS issues used for Angular)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions