Skip to content

Instantly share code, notes, and snippets.

@Alvaro237
Created February 13, 2022 10:55
Show Gist options
  • Select an option

  • Save Alvaro237/f96e89e9ca0bdad7a11f6fed7873e188 to your computer and use it in GitHub Desktop.

Select an option

Save Alvaro237/f96e89e9ca0bdad7a11f6fed7873e188 to your computer and use it in GitHub Desktop.

Revisions

  1. Alvaro237 created this gist Feb 13, 2022.
    1 change: 1 addition & 0 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Split app modules in features modules and core module, don't import in app.module.ts feature modules, they have to be imported dynamiclly
    28 changes: 28 additions & 0 deletions app-routing.module.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    import { NgModule } from '@angular/core';
    import { Routes, RouterModule } from '@angular/router';

    const appRoutes: Routes = [
    { path: '', redirectTo: '/recipes', pathMatch: 'full' },
    {
    path: 'recipes',
    loadChildren: () =>
    import('./recipes/recipes.module').then(m => m.RecipesModule)
    },
    {
    path: 'shopping-list',
    loadChildren: () =>
    import('./shopping-list/shopping-list.module').then(
    m => m.ShoppingListModule
    )
    },
    {
    path: 'auth',
    loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule)
    }
    ];

    @NgModule({
    imports: [RouterModule.forRoot(appRoutes)],
    exports: [RouterModule]
    })
    export class AppRoutingModule {}