import { Component, Input, OnChanges } from '@angular/core'; @Component({ selector: 'bom-part-pipeline', templateUrl: './bom-part-pipeline.component.html', styleUrls: ['./bom-part-pipeline.component.scss'] }) export class BomPartPipelineComponent implements OnChanges { @Input() pipeline: any[] = []; @Input() leadTimes: Set = new Set(); @Input() loading: boolean; lowestLeadTime: number = 0; constructor() {} ngOnChanges() { if (this.leadTimes.size > 0) { this.leadTimes.forEach(leadTime => { if (this.lowestLeadTime === 0) { this.lowestLeadTime = leadTime; } this.lowestLeadTime = Math.min(this.lowestLeadTime, leadTime); }); } } }