File

src/app/modules/shared/components/app-landing-section/app-landing-section.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(layoutService: LayoutService, resourceService: ResourceService)
Parameters :
Name Type Optional
layoutService LayoutService No
resourceService ResourceService No

Inputs

layoutConfiguration
Type : any
noTitle
Type : any
svgToDisplay
Type : any
textToDisplay
Type : any

Methods

initLayout
initLayout()
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void
redoLayout
redoLayout()
Returns : void

Properties

FIRST_PANEL_LAYOUT
Public layoutService
Type : LayoutService
SECOND_PANEL_LAYOUT
titleToDisplay
Public unsubscribe$
Default value : new Subject<void>()
import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core';
import { LayoutService, COLUMN_TYPE } from '../../services/layoutconfig/layout.service';
import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { ResourceService } from '../../services';

@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: 'app-landing-section',
  templateUrl: './app-landing-section.component.html',
  styleUrls: ['./app-landing-section.component.scss']
})
export class AppLandingSectionComponent implements OnInit {

  @Input() textToDisplay;

  @Input() svgToDisplay;

  @Input() layoutConfiguration;

  @Input() noTitle;

  FIRST_PANEL_LAYOUT;
  SECOND_PANEL_LAYOUT;
  titleToDisplay;
  public unsubscribe$ = new Subject<void>();

  constructor(public layoutService: LayoutService, private resourceService: ResourceService) { }

  ngOnInit() {
    this.initLayout();
  }
  initLayout() {
    this.redoLayout();
    this.layoutService.switchableLayout().
        pipe(takeUntil(this.unsubscribe$)).subscribe(layoutConfig => {
        if (layoutConfig != null) {
          this.layoutConfiguration = layoutConfig.layout;
        }
        this.redoLayout();
      });
  }
  redoLayout() {
      if (this.layoutConfiguration != null) {
        this.FIRST_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(0, this.layoutConfiguration, COLUMN_TYPE.threeToNine);
        this.SECOND_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(1, this.layoutConfiguration, COLUMN_TYPE.threeToNine);
      } else {
        this.FIRST_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(0, null, COLUMN_TYPE.fullLayout);
        this.SECOND_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(1, null, COLUMN_TYPE.fullLayout);
      }
  }
  ngOnDestroy() {
    this.unsubscribe$.next();
    this.unsubscribe$.complete();
  }

}
<div class="sbt-fluid-header-bg mb-8 hide hidden" *ngIf="layoutConfiguration">
  <div class="sb-g sbt-container sbt-page-header" [ngClass]="{'sb-no-title': noTitle}">
    <div [ngClass]="FIRST_PANEL_LAYOUT">
    </div>
    <div class="relative" [ngClass]="SECOND_PANEL_LAYOUT">
      <img *ngIf="!noTitle" class="sbt-page-header-line-img" src="./assets/images/header-line.svg" alt="header line path image">
      <div class="sbt-page-header-content pl-24" tabindex="0" [ngClass]="{'sb-no-title': noTitle}">
        <h1 *ngIf="!noTitle">{{textToDisplay | translate}}</h1>
      </div>
      <img *ngIf="!noTitle" class="sbt-page-header-img" src="./assets/images/banner-svg/{{svgToDisplay}}" alt="Textbooks">
    </div>
  </div>
</div>
<div *ngIf="!layoutConfiguration"></div>

./app-landing-section.component.scss

.sb-no-title {
    height: 3rem;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""