У меня есть массив, который обновляется из другого компонента (происходит обновление, и строки добавляются в массив, который я проверил с помощью тестовой кнопки), но ngOnChanges не обнаружит никаких изменений. Что не так с моим кодом?
Я применяю изменение: array.push().
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import {MatAccordion} from '@angular/material/expansion';
@Component({
selector: 'app-cart',
templateUrl: './cart.component.html',
styleUrls: ['./cart.component.css']
})
export class CartComponent implements OnInit, OnChanges {
totalPrice = 0;
constructor() { }
@Input() Products: Array<String>;
ngOnChanges() {
console.log(this.Products)
}
ngOnInit(): void {
}
}