Skip to content
Snippets Groups Projects
report.component.ts 883 B
Newer Older
  • Learn to ignore specific revisions
  • Martin Mechtel's avatar
    Martin Mechtel committed
    import { SyscheckDataService, ReportEntry } from './../syscheck-data.service';
    
    Martin Mechtel's avatar
    Martin Mechtel committed
    import { Component, OnInit } from '@angular/core';
    
    @Component({
      selector: 'iqb-report',
      templateUrl: './report.component.html',
      styleUrls: ['./report.component.css']
    })
    export class ReportComponent implements OnInit {
      reportEnabled = false;
    
    Martin Mechtel's avatar
    Martin Mechtel committed
      environmentData: ReportEntry[] = [];
      networkData: ReportEntry[] = [];
      questionnaireData: ReportEntry[] = [];
    
    Martin Mechtel's avatar
    Martin Mechtel committed
    
      constructor(
        private ds: SyscheckDataService
      ) {
      }
    
      ngOnInit() {
    
    Martin Mechtel's avatar
    Martin Mechtel committed
        // this.ds.environmentData$.subscribe(rd => ); too early!
        this.ds.networkData$.subscribe(rd => {
          this.networkData = rd;
          this.environmentData = this.ds.environmentData$.getValue();
        });
    
    Martin Mechtel's avatar
    Martin Mechtel committed
        this.ds.questionnaireData$.subscribe(rd => this.questionnaireData = rd);
    
        this.ds.reportEnabled$.subscribe(is => this.reportEnabled = is);
    
    Martin Mechtel's avatar
    Martin Mechtel committed
      }
    }