I work on angular 7 I have array of two object json inside app.component.ts
I need to compare between two object but i need to display compare vertically .
this link have json array and sample
code I try as below :
- import { Component, OnInit } from '@angular/core';
-
- @Component({
- selector: 'my-app',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent implements OnInit {
- private ldapcaches = [
- { "id": 1, "host": "localhost", "filesize": 73, "fileage": "2018-01-26 09:26:40" },
- { "id": 2, "host": "localhost", "filesize": 21, "fileage": "2018-01-26 09:26:32" },
- ];
- private originalCache = null;
- constructor() {
- }
- ngOnInit() {
- for(let cache of this.ldapcaches) {
-
- }
- console.log(this.originalCache);
- }
- }
compare firstitem seconditem
host localhost localhost
filesize 73 21
fileage 2018-01-26 09:26:40 2018-01-26 09:26:32
so I need
How to display expected result vertically with colorized difference with red as above ?
what i write on app.component.html
and what i write on ng oninit ?