All files / src/app/shared/cms/components/content-slot content-slot.component.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 415x   5x                                               5x                            
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
 
import { ContentPageletView } from 'ish-core/models/content-view/content-view.model';
 
/**
 * The Content Slot Component renders the assigned sub pagelets
 * of the identified 'slot' of the given 'pagelet'.
 * By default it is just using the {@link ContentPageletComponent}
 * to render each sub pagelet.
 * If more specific HTML or functionality is needed for the rendering
 * the 'wrapper' flag needs to be used to use the provided HTML for rendering.
 *
 * @example
 * <ish-content-slot [slot]="'app_pwa:slot.pagelet2-Slot'" [pagelet]="pagelet"></ish-content-slot>
 *
 * <ish-content-slot [wrapper]="true" [slot]="'app_pwa:slot.pagelet2-Slot'" [pagelet]="pagelet">
 *               <div *ngFor="let slotPagelet of slotPagelets">
 *                 <ish-content-pagelet [pageletId]="slotPagelet"></ish-content-pagelet>
 *               </div>
 * </ish-content-slot>
 */
@Component({
  selector: 'ish-content-slot',
  templateUrl: './content-slot.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ContentSlotComponent {
  /**
   * The DefinitionQualifiedName of the slot that should be rendered.
   */
  @Input({ required: true }) slot: string;
  /**
   * The parent Pagelet that contains the slot.
   */
  @Input() pagelet: ContentPageletView;
  /**
   * An optional flag that controls the rendering of the pagelets with the wrapped HTML content.
   */
  @Input() wrapper: boolean;
}