Using Template TABS and trying to add new route (No component factory found for HelloworldPageModule)

18 Views Asked by At

im trying ionic for the first time. I created a project using the template TABS and im trying to add a new page with new botton in the bottom menu. I did this:

1) ionic generate page helloworld

2) In tabs-routing.module.ts i added the new route:

const routes: Routes = [
    {
        path: 'tabs',
        component: TabsPage,
        children: [
            {
                path: 'home',
                children: [
                    {
                        path: '',
                        loadChildren: () => import('../helloworld/helloworld.module').then(m => m.HelloworldPageModule)
                    }
                ]
            },
            {
                path: 'tab1',
                children: [
                    {
                        path: '',
                        loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule)
                    }
                ]
            },
            {
                path: 'tab2',
                children: [
                    {
                        path: '',
                        loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
                    }
                ]
            },
            {
                path: 'tab3',
                children: [
                    {
                        path: '',
                        loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
                    }
                ]
            },
            {
                path: '',
                redirectTo: '/tabs/home',
                pathMatch: 'full'
            }
        ]
    },
    {
        path: '',
        redirectTo: '/tabs/home',
        pathMatch: 'full'
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class TabsPageRoutingModule {
}

In tabs.page.html i added

<ion-tab-button tab="home">
      <ion-icon name="home"></ion-icon>
      <ion-label>Home</ion-label>
    </ion-tab-button>

But this is the error: https://aws1.discourse-cdn.com/ionicframework/original/3X/b/e/bebad2c6927130e1c0d733b75ea0b3864e59faa4.png

1

There are 1 best solutions below

0
Toriga On

I dont know. But i deleted this page, and stopped the server, i did again all like before, and now work.