I have an array that is getting updated from another component (the update is happening and Strings are getting added into the array I've checked it with a test button) but ngOnChanges wont detect any change. What is wrong with my code?
The change I apply is 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 {
}
}