1 import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core';
4 selector: 'app-validate-success-component',
5 templateUrl: './validate-success-component.component.html',
6 styleUrls: ['./validate-success-component.component.css'],
7 changeDetection: ChangeDetectionStrategy.OnPush
9 export class ValidateSuccessComponentComponent implements OnInit {
11 @Input('tableObj') tableObj : any;
16 finalDisplayObjArr : any[] = new Array();
17 subArr : string[] = new Array();
25 //console.log(this.tableObj);
26 this.rows = new Array();
27 this.headers = new Array();
28 this.finalDisplayObjArr = new Array();
30 this.tableObj = this.tableObj;
32 this.headers = JSON.parse(this.tableObj)["reportDataColumns"];
33 this.rows = JSON.parse(this.tableObj)["reportDataRows"];
35 // for(let i=0; i<this.headers.length; i++)
37 // this.subArr.push(this.headers[i]);
39 // this.finalDisplayObjArr.push(this.subArr);
41 for(let i=0; i<this.rows.length; i++)
45 for(let j=0; j<this.headers.length; j++)
47 //console.log(this.rows[i][this.headers[j]]);
48 this.subArr.push(this.rows[i][this.headers[j]]);
52 // console.log(this.subArr);
53 this.finalDisplayObjArr.push(this.subArr);
57 console.log(this.finalDisplayObjArr);