Skip to content

Commit

Permalink
Add lazily routed route to features
Browse files Browse the repository at this point in the history
  • Loading branch information
belsman committed Jan 12, 2024
1 parent 887dbbe commit 62c99df
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 42 deletions.
62 changes: 38 additions & 24 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,44 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
// {
// path: 'returns',
// component: ReturnsComponent,
// },
// {
// path: 'click-and-collect',
// component: ClickAndCollectComponent,
// },
// {
// path: 'delivery',
// component: DeliveryComponent,
// },
// {
// path: 'profile',
// component: ProfileComponent,
// },
// {
// path: 'about-us',
// component: ImprintComponent,
// },
// {
// path: 'privacy-statement',
// component: PrivacyPolicyComponent,
// },
{
path: 'returns',
loadChildren: () =>
import('./features/returns/returns.module').then((m) => m.ReturnsModule),
},
{
path: 'click-and-collect',
loadChildren: () =>
import('./features/click-and-collect/click-and-collect.module').then(
(m) => m.ClickAndCollectModule
),
},
{
path: 'delivery',
loadChildren: () =>
import('./features/delivery/delivery.module').then(
(m) => m.DeliveryModule
),
},
{
path: 'profile',
loadChildren: () =>
import('./features/user-profile/user-profile.module').then(
(m) => m.UserProfileModule
),
},
{
path: 'about-us',
loadChildren: () =>
import('./features/imprint/imprint.module').then((m) => m.ImprintModule),
},
{
path: 'privacy-statement',
loadChildren: () =>
import('./features/privacy-policy/privacy-policy.module').then(
(m) => m.PrivacyPolicyModule
),
},
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ClickAndCollectComponent } from './pages/click-and-collect/click-and-collect.component';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from 'src/app/shared/shared.module';

const routes: Routes = [
{
Expand All @@ -12,6 +13,6 @@ const routes: Routes = [

@NgModule({
declarations: [ClickAndCollectComponent],
imports: [CommonModule, RouterModule.forChild(routes)],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
})
export class ClickAndCollectModule {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ScreenService } from 'src/app/services/screen.service';
import { Component } from '@angular/core';
import { ScreenService } from 'src/app/core/services/screen.service';

@Component({
selector: 'app-click-and-collect',
Expand Down
3 changes: 2 additions & 1 deletion src/app/features/delivery/delivery.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DeliveryComponent } from './pages/delivery/delivery.component';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from 'src/app/shared/shared.module';

const routes: Routes = [
{
Expand All @@ -12,6 +13,6 @@ const routes: Routes = [

@NgModule({
declarations: [DeliveryComponent],
imports: [CommonModule, RouterModule.forChild(routes)],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
})
export class DeliveryModule {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { ScreenService } from 'src/app/services/screen.service';
import { ScreenService } from 'src/app/core/services/screen.service';

@Component({
selector: 'app-delivery',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';

@Component({
selector: 'app-imprint',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { PrivacyPolicyComponent } from './pages/privacy-policy/privacy-policy.component';
import { SharedModule } from 'src/app/shared/shared.module';

const routes: Routes = [
{
Expand All @@ -12,6 +13,6 @@ const routes: Routes = [

@NgModule({
declarations: [PrivacyPolicyComponent],
imports: [CommonModule, RouterModule.forChild(routes)],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
})
export class PrivacyPolicyModule {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { ScreenService } from 'src/app/services/screen.service';
import { ScreenService } from 'src/app/core/services/screen.service';

@Component({
selector: 'app-returns',
Expand Down
3 changes: 2 additions & 1 deletion src/app/features/returns/returns.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { ReturnsComponent } from './pages/returns/returns.component';
import { SharedModule } from 'src/app/shared/shared.module';

const routes: Routes = [
{
Expand All @@ -12,6 +13,6 @@ const routes: Routes = [

@NgModule({
declarations: [ReturnsComponent],
imports: [CommonModule, RouterModule.forChild(routes)],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
})
export class ReturnsModule {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- <section class="content-area" role="main">
<section class="content-area" role="main">
<h1>{{ "Profile.Title" | translate }}</h1>
<hr />
<div class="row mb-2">
Expand Down Expand Up @@ -53,10 +53,4 @@ <h2>{{ "Profile.CreateAnAccount" | translate }}</h2>
</div>
</div>
</div>
</section> -->
<h3>OK</h3>
<!-- <vcl-icogram>GOAT</vcl-icogram> -->

<!-- <vcl-icogram>
{{ "Profile.Continue" | translate }}
</vcl-icogram> -->
</section>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { ScreenService } from 'src/app/services/screen.service';
import { ScreenService } from 'src/app/core/services/screen.service';

@Component({
selector: 'app-profile',
Expand Down

0 comments on commit 62c99df

Please sign in to comment.