Skip to main content
Flox Blog Beginner's Guide for Web Developers. 60% Off in Website Design & Development click here.

Angular Error: Template parse errors: Unexpected closing tag “a”. It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags

This is the Angular Error.

Error: Template parse errors:
Unexpected closing tag "a". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags ("">
            <a [routerLink]=[/]><img src="/assets/images/logo.jpg" alt="" title="">[ERROR ->]</a>
        </div>
        <app-navigation></app-navigation>
"): ng:///AppModule/[email protected]:97

How to solve this:

Go to the Component HTML file. Where you type “a” tag. Then correct this type of Code.

<header id="header">
    <div class="container">
        <div class="logo">
            <a [routerLink]="['/']"><img src="/assets/images/logo.jpg" alt="ConLeed" title="ConLeed"></a>
        </div>
        <app-navigation></app-navigation>
    </div>
</header>

[routerLink]=”[‘/’]” This is the correct attribute for this error.

Leave a Reply

avatar
  Subscribe  
Notify of
F