How to fix Angular Parser Error: Private identifiers are not supported. Unexpected private identifier: ...
Problem:
When trying to run our Angular application, you see the following error:
error_message.txt
Error: src/app/my-component.html:18:31 - error NG5002: Parser Error: Private identifiers are not supported. Unexpected private identifier: #noNamerelated to source like
example.html
<span *ngIf="name ; else #noName">
    {{name}}
</span>
<ng-template #noName>
    <span><i>Name not configured</i></span>
</ng-template>Solution
In the ; else #noName clause, remove the # character => ; else noName to fix the error:
example.html
<span *ngIf="name ; else noName">
    {{name}}
</span>
<ng-template #noName>
    <span><i>Name not configured</i></span>
</ng-template>Check out similar posts by category:
Angular, Typescript
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow