问题
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>
来源:https://stackoverflow.com/questions/55244213/angular-router-outlet-load-before-header-component-how-to-prevent