Skip to content

Commit b8ae40d

Browse files
dhhyishauke
authored andcommitted
feat: generate lazy component for content-include to be used in application shell
1 parent beea0b4 commit b8ae40d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/app/shared/cms/components/content-include/content-include.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@ import { takeUntil } from 'rxjs/operators';
1212

1313
import { CMSFacade } from 'ish-core/facades/cms.facade';
1414
import { ContentPageletEntryPointView } from 'ish-core/models/content-view/content-view.model';
15+
import { GenerateLazyComponent } from 'ish-core/utils/module-loader/generate-lazy-component.decorator';
1516
import { SfeMetadataWrapper } from 'ish-shared/cms/sfe-adapter/sfe-metadata-wrapper';
1617

1718
/**
1819
* The Content Include Container Component renders the content of the include with the given 'includeId'.
19-
* For rendering is uses the {@link ContentPageletContainerComponent} for each sub pagelet.
20+
* For rendering it uses the {@link ContentPageletContainerComponent} for each sub pagelet.
2021
*
2122
* @example
2223
* <ish-content-include includeId="pwa.include.homepage.pagelet2-Include"></ish-content-include>
24+
* or with lazy loading within the application shell
25+
* <ish-lazy-content-include includeId="include.footer.pagelet2-Include"></ish-lazy-content-include>
2326
*/
2427
@Component({
2528
selector: 'ish-content-include',
2629
templateUrl: './content-include.component.html',
2730
changeDetection: ChangeDetectionStrategy.OnPush,
2831
})
32+
@GenerateLazyComponent()
2933
export class ContentIncludeComponent extends SfeMetadataWrapper implements OnInit, OnDestroy, OnChanges {
3034
/**
3135
* The ID of the Include whoes content is to be rendered.

src/app/shell/shared/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/lazy**

src/app/shell/shell.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { ProductImageComponent } from './header/product-image/product-image.comp
3535
import { SearchBoxComponent } from './header/search-box/search-box.component';
3636
import { SubCategoryNavigationComponent } from './header/sub-category-navigation/sub-category-navigation.component';
3737
import { UserInformationMobileComponent } from './header/user-information-mobile/user-information-mobile.component';
38+
import { LazyContentIncludeComponent } from './shared/lazy-content-include/lazy-content-include.component';
3839

3940
const importExportModules = [
4041
CaptchaExportsModule,
@@ -78,6 +79,7 @@ const exportedComponents = [
7879
HeaderNavigationComponent,
7980
HeaderSimpleComponent,
8081
LanguageSwitchComponent,
82+
LazyContentIncludeComponent,
8183
LoginStatusComponent,
8284
MiniBasketComponent,
8385
ProductCompareStatusComponent,

0 commit comments

Comments
 (0)