Yrkki/cv-generator-fe

View on GitHub
src/app/components/header/header.component.html

Summary

Maintainability
Test Coverage
<ng-template #headerContent let-key="key" let-nextSortElement="nextSortElement">
  <app-header-title #headerTitle [key]="key" [nextSortElement]="nextSortElement"></app-header-title>
  <app-toolbar #toolbar [key]="key" [toggles]="toggles"></app-toolbar>
</ng-template>

<header *ngIf="portfolioService.toolbarService.editMode || !portfolioService.persistenceService.getToggleValue(key)"
  [id]="entities[key]?.key" #clickable (keypress)="keypress($event)" (click)="saveToggle($event)" data-toggle="collapse"
  [attr.data-target]="'#' + entities[key]?.content" [attr.aria-labelledby]="tabName(key)">
  <ng-container *ngIf="portfolioService.toolbarService.editMode || !editModeOnly" [class.print-hidden]="editModeOnly">
    <h1 *ngIf="headingLevel === 1" [class.decorations]="decorations">
      <ng-container
        *ngTemplateOutlet="headerContent;context:{key: entities[key]?.key, nextSortElement: nextSortElement}">
      </ng-container>
    </h1>
    <h2 *ngIf="headingLevel === 2" [class.decorations]="decorations">
      <ng-container
        *ngTemplateOutlet="headerContent;context:{key: entities[key]?.key, nextSortElement: nextSortElement}">
      </ng-container>
    </h2>
    <h3 *ngIf="headingLevel === 3" [class.decorations]="decorations">
      <ng-container
        *ngTemplateOutlet="headerContent;context:{key: entities[key]?.key, nextSortElement: nextSortElement}">
      </ng-container>
    </h3>
    <h4 *ngIf="headingLevel === 4" [class.decorations]="decorations">
      <ng-container
        *ngTemplateOutlet="headerContent;context:{key: entities[key]?.key, nextSortElement: nextSortElement}">
      </ng-container>
    </h4>
    <h5 *ngIf="headingLevel === 5" [class.decorations]="decorations">
      <ng-container
        *ngTemplateOutlet="headerContent;context:{key: entities[key]?.key, nextSortElement: nextSortElement}">
      </ng-container>
    </h5>
    <h6 *ngIf="headingLevel === 6" [class.decorations]="decorations">
      <ng-container
        *ngTemplateOutlet="headerContent;context:{key: entities[key]?.key, nextSortElement: nextSortElement}">
      </ng-container>
    </h6>
  </ng-container>
</header>