Skip to content

Commit

Permalink
feat: generate lazy component for content-include to be used in appli…
Browse files Browse the repository at this point in the history
…cation shell
  • Loading branch information
dhhyi authored and shauke committed Feb 23, 2021
1 parent beea0b4 commit b8ae40d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@ import { takeUntil } from 'rxjs/operators';

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

/**
* The Content Include Container Component renders the content of the include with the given 'includeId'.
* For rendering is uses the {@link ContentPageletContainerComponent} for each sub pagelet.
* For rendering it uses the {@link ContentPageletContainerComponent} for each sub pagelet.
*
* @example
* <ish-content-include includeId="pwa.include.homepage.pagelet2-Include"></ish-content-include>
* or with lazy loading within the application shell
* <ish-lazy-content-include includeId="include.footer.pagelet2-Include"></ish-lazy-content-include>
*/
@Component({
selector: 'ish-content-include',
templateUrl: './content-include.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
@GenerateLazyComponent()
export class ContentIncludeComponent extends SfeMetadataWrapper implements OnInit, OnDestroy, OnChanges {
/**
* The ID of the Include whoes content is to be rendered.
Expand Down
1 change: 1 addition & 0 deletions src/app/shell/shared/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/lazy**
2 changes: 2 additions & 0 deletions src/app/shell/shell.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { ProductImageComponent } from './header/product-image/product-image.comp
import { SearchBoxComponent } from './header/search-box/search-box.component';
import { SubCategoryNavigationComponent } from './header/sub-category-navigation/sub-category-navigation.component';
import { UserInformationMobileComponent } from './header/user-information-mobile/user-information-mobile.component';
import { LazyContentIncludeComponent } from './shared/lazy-content-include/lazy-content-include.component';

const importExportModules = [
CaptchaExportsModule,
Expand Down Expand Up @@ -78,6 +79,7 @@ const exportedComponents = [
HeaderNavigationComponent,
HeaderSimpleComponent,
LanguageSwitchComponent,
LazyContentIncludeComponent,
LoginStatusComponent,
MiniBasketComponent,
ProductCompareStatusComponent,
Expand Down

0 comments on commit b8ae40d

Please sign in to comment.