Angular 2 Duplicate Header

2019-02-19 08:57发布

Duplicate header issue occurs, while using the <router-outlet></router-outlet> in the AppComponent Template.

https://github.com/cstodor/a2pbp/

I'm using 'angular 2.0.0-rc.6' and 'router 3.0.0-rc.1'

Does anyone have any idea, why is this happening?

1条回答
孤傲高冷的网名
2楼-- · 2019-02-19 09:38

The application is showing two headers on start because your default path is set to be your AppComponent, which has the header included. That path is shown inside of another AppComponent, which you started in your app.module.ts in the bootstrap field. You can resolve this by replacing your default path with another component.

Please also make sure to upgrade your package.json according to the latest package list at https://angular.io/guide/quickstart.

查看更多
登录 后发表回答