Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48984

Lazy Loading on Ionic 5 Tabs project

$
0
0

Hi, I am starting new project with Ionic 5- Angular 11 with the tabs template.

To Lazy load components I was doing this following this article an this article:

import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  {
    path: '',
    loadChildren: './tabs/tabs.module#TabsPageModule'
    data: { preload: true },
  }
];
@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}

But when I launch the app with ionic serve ir not loads the app with this error:

ERROR Error: Uncaught (in promise): Error: Cannot find module ‘./tabs/tabs.module’

Can someone help me with this?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48984

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>