I am creating a starter project for me. What i need to do is create a component in which i call navbar, sidebar, footer and a page that i want to show as router.
This is my app.routing
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LayoutComponent } from './layout/layout.component';
import { LoginComponent } from './screens/auth/login/login.component';
import { StatsComponent } from './screens/stats/stats.component';
const appRoutes: Routes = [
{ path: '', component: LoginComponent },
{ path: 'Dashboard', component: LayoutComponent },
{ path: 'login', component: LoginComponent },
{ path: 'stats', component: StatsComponent }
];
@NgModule({
imports: [RouterModule.forRoot(appRoutes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
I have a simple login page by which i go to dashboard rout
<h1>Angular Router App</h1>
<nav>
<ul>
<li><a routerLink="/Dashboard/login" routerLinkActive="active">Login</a></li>
</ul>
</nav>
This is my LayoutComponent (Dashboard)
<div class="wrapper">
<div class="app-sidebar" data-active-color="white" data-background-color="black" data-image="assets/img/sidebar-bg/01.jpg">
<p>Sidebar</p>
<div class="sidebar-background"></div>
</div>
<!-- <app-navbar></app-navbar> -->
<p>NavBar</p>
<div class="main-panel">
<div class="main-content">
<div class="content-wrapper">
<div class="container-fluid">
<router-outlet></router-outlet>
</div>
</div>
</div>
<!-- <app-footer></app-footer> -->
<p>Footer</p>
</div>
</div>
You can see I have <router-outlet></router-outlet> on this page this I need to know how can I show another component in this? I have a component stats on app-routing. Do I need to show that component inside this layout how can I show this as routing?
Mean something like Dashboard/stats