From 2164519afb5c88c321a9534b796bf36599c1887b Mon Sep 17 00:00:00 2001 From: hichri-louay <124356992+hichri-louay@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:36:38 +0100 Subject: [PATCH] add lazy loading for campaign details module (#563) --- .../campaign-details/campaign-details-routing.module.ts | 4 ++-- src/app/campaigns/campaigns-routing.module.ts | 8 ++++---- src/app/campaigns/campaigns.module.ts | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/campaigns/campaign-details/campaign-details-routing.module.ts b/src/app/campaigns/campaign-details/campaign-details-routing.module.ts index 3c46cab83..3131043ef 100755 --- a/src/app/campaigns/campaign-details/campaign-details-routing.module.ts +++ b/src/app/campaigns/campaign-details/campaign-details-routing.module.ts @@ -8,7 +8,7 @@ import { CampaignDetailsContainerComponent } from './components/campaign-details import { PublicPagesGuard } from '@core/services/public-pages.guard'; const routes: Routes = [ - /*{ + { path: '', component: CampaignDetailsContainerComponent, children: [ @@ -27,7 +27,7 @@ const routes: Routes = [ canActivate: [AuthGuardService] } ] - }*/ + } ]; @NgModule({ diff --git a/src/app/campaigns/campaigns-routing.module.ts b/src/app/campaigns/campaigns-routing.module.ts index 611f50c13..7d5546314 100755 --- a/src/app/campaigns/campaigns-routing.module.ts +++ b/src/app/campaigns/campaigns-routing.module.ts @@ -37,7 +37,7 @@ const routes: Routes = [ { path: '', redirectTo: '/welcome', pathMatch: 'full' } ] }, - { + /*{ path:'campaign/:id', component: CampaignDetailComponent }, @@ -50,14 +50,14 @@ const routes: Routes = [ path: 'campaign/:id/recover-my-gains', component: RecoverGainsComponent, canActivate: [AuthGuardService] - }, - /*{ + },*/ + { path: 'campaign/:id', loadChildren: () => import('./campaign-details/campaign-details.module').then( (m) => m.CampaignDetailsModule ), - },*/ + }, { path: 'welcome', component: FarmWelcomeComponent diff --git a/src/app/campaigns/campaigns.module.ts b/src/app/campaigns/campaigns.module.ts index 28a2eafd4..6f03f28ff 100755 --- a/src/app/campaigns/campaigns.module.ts +++ b/src/app/campaigns/campaigns.module.ts @@ -35,7 +35,7 @@ import { DraftPictureComponent } from './components/draft-picture/draft-picture. import { CommonModule } from '@angular/common'; import { SocialsComponent } from './socials/socials.component'; import { SharedModule } from '@app/shared/shared.module'; -import { CampaignDetailsModule } from './campaign-details/campaign-details.module'; + @NgModule({ declarations: [ CampaignsDashboardComponent, @@ -63,7 +63,6 @@ import { CampaignDetailsModule } from './campaign-details/campaign-details.modul imports: [ CommonModule, CampaignsRoutingModule, - CampaignDetailsModule, CampaignsSharedUiModule, NgxTweetModule, EffectsModule.forFeature([LinksListEffects]),