As in the app-component.html
below. The router-outlet
components load before app-header
component. How to prevent router components to load before header and footer.
<!--The content below is only a placeholder and can be replaced.-->
<app-header *ngIf="router.url !== '/login' && router.url !== '/register-user'">
</app-header>
<div>
<router-outlet></router-outlet>
</div>
<app-footer *ngIf="router.url !== '/login' &&
router.url !== '/register-user'"></app-footer>