Search code examples
angularangular-router

Duplicate component in Angular


I have a navbar component in my AppComponent but I don't know why navbar component is duplicated.

I've only navbar

AppComponent

navbar duplicated

View


Solution

  • Update your app.component.html file by following code

    <router-outlet></router-outlet>
    

    You might have added navbar-component into your routing file that is why angular rending first navbar from selector another rendering from .

    Hope you get your solution, Thanks!