I have an app which has multiple views like navigation and pages. So I added a layout module and imported that module to the main module & now trying to use layout modules navigation component in app component. So this should show navigation.html content but its coming as blank. It's not giving any error as well. Not sure what I am doing wrong. Well below is my code that will give the proper picture: here is app.model.ts
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { LayoutsModule } from './layouts/index'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, LayoutsModule, AppRoutingModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
and here is LayoutsModule
import { NgModule } from '@angular/core'; import { NavigationComponent } from './navigation/navigation.component'; @NgModule({ declarations: [ NavigationComponent ], exports: [ ], imports: [ ], providers: [ ] }) export class LayoutsModule {}
and my app.component.html
<app-navigation></app-navigation> <router-outlet></router-outlet>