I recently implemented a delete button functionality in my project to remove elements when clicked, but I'm facing an issue where the input decorator is not properly receiving data for deletion. When I console log, it shows that the array is empty which adds to the confusion. This scenario highlights a challenge I am currently tackling in a small project. Any insights on how to improve the usage of input decorators and best practices would be highly appreciated.
ChildComponent:
public valuesCheck: string [] = [];
@Input() valuesFilter: string[] = [];
public deleteClick(){
let chipValue = string [] = [];
this.valuesCheck = this.valuesFilter = chipValue;
chipValue.splice(0,1);
}
Parent Component:
public filters: CFilter[] | undefined;
Parent HTML:
<app-filter-chip [valuesFiter] = "chipValue">
<app-filter-chip>
Child HTML:
<div class="chip>
<button class="closebtn" (click)="deleteClick()">
<div>