import { Component, OnInit } from '@angular/core';
import { NgCloneDeepService } from 'ng-clone-deep';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
source = [{name: 'Tom'}, {name: 'Jerry'}];
constructor(private cloneDeep: NgCloneDeepService) {}
ngOnInit() {
const sourceClone = this.cloneDeep.clone(this.source);
}
}