You can remove the page from your page. To achieve the desired result, you can make all the components that should display the header component as its child route.
You can achieve this as follows:
{ path: 'dashboard', component: HeaderComponent, children: [
{ path: '', component: HeaderComponent },
{ path: 'mypath', component: MyComponent } ]
},
{ path: 'login', component: LoginComponent }
, , HeaderComponent, HeaderComponent .
HeaderComponent.