File

components/content/content.component.ts

Description

Main content for dynamic hazard compare applications with tabs:

  • Plots tab: show dynamic hazard compare plots
  • Hazard data tab: table of hazard data
  • Spectra data tab: table of spectra data

Metadata

Index

Properties

Constructor

constructor(service: AppService)
Parameters :
Name Type Optional
service AppService No

Properties

hasData
Default value : computed(() => { const {modelA, modelB} = this.service.serviceResponses(); return ( modelA?.hazardResponse !== undefined && modelB?.hazardResponse !== undefined ); })

Whether there is data

import {Component, computed} from '@angular/core';
import {MatTab, MatTabContent, MatTabGroup} from '@angular/material/tabs';

import {AppService} from '../../services/app.service';
import {HazardDataComponent} from '../hazard-data/hazard-data.component';
import {PlotsComponent} from '../plots/plots.component';
import {SpectraDataComponent} from '../spectra-data/spectra-data.component';

/**
 * Main content for dynamic hazard compare applications with tabs:
 *  - Plots tab: show dynamic hazard compare plots
 *  - Hazard data tab: table of hazard data
 *  - Spectra data tab: table of spectra data
 */
@Component({
  imports: [
    MatTabGroup,
    MatTab,
    MatTabContent,
    PlotsComponent,
    HazardDataComponent,
    SpectraDataComponent,
  ],
  selector: 'app-content',
  styleUrl: './content.component.scss',
  templateUrl: './content.component.html',
})
export class ContentComponent {
  /** Whether there is data */
  hasData = computed(() => {
    const {modelA, modelB} = this.service.serviceResponses();

    return (
      modelA?.hazardResponse !== undefined &&
      modelB?.hazardResponse !== undefined
    );
  });

  constructor(private service: AppService) {}
}
<mat-tab-group class="height-full">
  <!-- Plot tab -->
  <mat-tab label="Plots">
    <ng-template matTabContent>
      <app-plots />
    </ng-template>
  </mat-tab>

  <!-- Data tab -->
  <mat-tab label="Hazard Curve Data" [disabled]="hasData() === false">
    <ng-template matTabContent>
      <app-hazard-data />
    </ng-template>
  </mat-tab>

  <!-- Spectra tab -->
  <mat-tab label="Response Spectrum Data" [disabled]="hasData() === false">
    <ng-template matTabContent>
      <app-spectra-data />
    </ng-template>
  </mat-tab>
</mat-tab-group>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""