All files / src/app/pages/account-content account-content-page.component.ts

100% Statements 11/11
75% Branches 3/4
100% Functions 3/3
100% Lines 11/11

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 321x 1x     1x   1x             1x       8x   8x     8x 8x     8x 5x        
import { ChangeDetectionStrategy, Component, DestroyRef, OnInit, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Observable } from 'rxjs';
 
import { CMSFacade } from 'ish-core/facades/cms.facade';
import { ContentPageletEntryPointView } from 'ish-core/models/content-view/content-view.model';
import { whenTruthy } from 'ish-core/utils/operators';
 
@Component({
  selector: 'ish-account-content-page',
  templateUrl: './account-content-page.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AccountContentPageComponent implements OnInit {
  contentPage$: Observable<ContentPageletEntryPointView>;
  contentPageLoading$: Observable<boolean>;
 
  private destroyRef = inject(DestroyRef);
 
  constructor(private cmsFacade: CMSFacade) {}
 
  ngOnInit() {
    this.contentPage$ = this.cmsFacade.contentPage$;
    this.contentPageLoading$ = this.cmsFacade.contentPageLoading$;
 
    // set breadcrumb data for account content pages
    this.contentPage$.pipe(whenTruthy(), takeUntilDestroyed(this.destroyRef)).subscribe(contentPage => {
      this.cmsFacade.setBreadcrumbForContentPage(contentPage.id);
    });
  }
}