I am loading all my route
via root component called AppComponent
(located in app.component.ts
) as follows:
app.component.html:
<app-header></app-header>
<div class="container">
<div class="row">
<div class="col-12">
<router-outlet></router-outlet>
</div>
</div>
</div>
<app-footer></app-footer>
Everything is fine till now. But Now I want to load a LoginCompoent
(at /login route) on entire page. Meaning there should is no header
or footer
, there should be just one component, LoginComponent
loaded when I go to /login.
I know I can create a new root component which loads AppComponent
or LoginComponent
depending on the route
. But I was wondering if there is a simple way to achieve this.