I am currently working on a parent-child component setup. Within the parent component, I have a
BehaviourSubject<SomeObject[]>()
.
export interface SomeObject(){
field: number;
...
editable: boolean
}
Before passing the object to the child component, I need to filter it so that the input value appears as follows:
childInputData = parentBehaviourSubject.value.filter(x=>...);
In the child component UI, there is an edit icon that is visible only if the field editable = false
. When this icon is clicked, it should change editable = true
and allow certain fields to be edited. My issue arises when trying to pass a cloned array as the child input. When I make the following change:
childInputData = _.cloneDeep(parentBehaviourSubject.value.filter(x=>...));
The UI edit icon no longer responds to clicks. I am unsure of what I am missing here. Can anyone provide insight into why this might be happening?