import { Component, OnInit, Input } from '@angular/core'; import { LogService } from './log.service'; @Component({ selector: 'app-log', templateUrl: './log.component.html', styleUrls: ['./log.component.css'] }) export class LogComponent implements OnInit { @Input("reportId") reportId1 : string; @Input("reportType") reportType : string; showSpinner : boolean; logDataList : {}[]; stepNo : string; constructor(private _logService : LogService) { this.showSpinner = false; this.logDataList = new Array(); } ngOnInit() { this.showSpinner = true; if(this.reportType === "Dashboard") { this.stepNo= "3"; } else { this.stepNo= "7"; } this._logService.getLogData(this.reportId1) .subscribe((responseLogData) => { this.showSpinner = true; this.logDataList = responseLogData; console.log(this.logDataList); this.showSpinner = false; }); } }