File

components/content/content.component.ts

Description

Main content for application with tabs:

  • Plots tab: show static hazard 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(() => this.service.serviceResponse() !== null)

Whether service has been called and has data

Public service
Type : AppService
import {Component, computed} from '@angular/core';
import {MatTab, MatTabContent, MatTabGroup} from '@angular/material/tabs';

import {AppService} from '../../services/app.service';
import {CurveDataComponent} from '../curve-data/curve-data.component';
import {PlotsComponent} from '../plots/plots.component';
import {SpectrumDataComponent} from '../spectrum-data/spectrum-data.component';

/**
 * Main content for application with tabs:
 *  - Plots tab: show static hazard plots
 *  - Hazard data tab: table of hazard data
 *  - Spectra data tab: table of spectra data
 */
@Component({
  imports: [
    MatTabGroup,
    MatTab,
    MatTabContent,
    PlotsComponent,
    CurveDataComponent,
    SpectrumDataComponent,
  ],
  selector: 'app-content',
  styleUrl: './content.component.scss',
  templateUrl: './content.component.html',
})
export class ContentComponent {
  /** Whether service has been called and has data */
  hasData = computed(() => this.service.serviceResponse() !== null);

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

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

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

results matching ""

    No results matching ""