LaVOZs

The World’s Largest Online Community for Developers

'; angular7 - Angular 7 page source not appearing for router outlet - LavOzs.Com

Im using angular 7 app with seo

@ng-toolkit/universal 

when i compile the app i can only see page source of app module

<app-header>
<router-outlet>
<app-about>
<app-footer

but for home module

<app-header>
<router-outlet>
<app-footer>

What could be the reason why not generating the source code? Here is app.component.ts

 this.router.events.subscribe(event => {

      if (event instanceof NavigationStart) {

        this.loading = true;
      }
      else if (event instanceof NavigationEnd || event instanceof NavigationCancel) {
        this.loading = false;

      }
});

app.component.html (i also tried without loading false)

<div class="off-canvas-wrapper wrapper">
  <!-- off-canvas-content - page content -->
  <div class="off-canvas-content" data-off-canvas-content>
    <app-top-header [hidden]="loading"></app-top-header>

    <div [hidden]="loading" class="router-output">
      <router-outlet></router-outlet>
    </div>

    <app-bottom-footer [hidden]="loading"></app-bottom-footer>
  </div>
  <!-- /end off-canvas-content -->
</div>

I tried this

{
    path: `home`,
    loadChildren: './home/home.module#HomeModule'
},

And this

   {//home module routes
        path: '',
        children: [
            {
                path: '',
                component: HomepageComponent
            },
        ]
    },

now at dev im doing like directly in app.module routes i thought it is due to lazy load

{
    path: '',
    component: HomepageComponent
},

but didn't worked for me (https://rentaga.com/ when open pls check after control + u pagesource you only see content from header and footer no router outlet page source)

Related
Router infinite loop with second canActivate guard on lazy-loaded modules
Angular 5 lazy loading Error: Cannot find module
Why does animate-on-scroll in router outlet not work and how to fix it?
Angular Universal not rendering content inside of router-outlet
Using angular-router to navigate views within a page
Angular Universal only showing page source for first page