The problem: You are mutating an array in the child component and the grids aren't getting notified of the changes, the grid seems to be checking ONLY for reference changes. (Check this answer for a similar problem)
You have two options
Option 1 - Use a EventEmitter
to notify parent of changes
Emit an event when the data changes.
@Output()
onDataChanged: EventEmitter<any> = new EventEmitter();
moveToTarget() {
this.targetList.push(this.sourceList.splice(0, 1)[0]);
console.log('this.targetList');
console.log(this.targetList);
console.log('this.sourceList');
console.log(this.sourceList);
this.onDataChanged.emit(); // <---
}
Then in the parent component, refresh the array upon receiving the event
<app-picklist [sourceList]="sourceFunction" [targetList]="targetFunction"
(onDataChanged)="refresh()"></app-picklist>
public refresh() {
this.sourceFunction = [...this.sourceFunction];
this.targetFunction = [...this.targetFunction];
}
Option 2 - Create a shared data service and make use of Observable
/BehaviorSubject
.