Input binding sends data to child component in unidirectional way, so when we modify child component data it doesn't flow up. Since you're assigning new blank array to this.appData in child component(it doesn't flow up). In this case you could consider changing your appData property binding to be two way binding. So that anything updates in child component will update the relative property in parent component, but yes it doesn't happen magically. You have to update the data manually ;)
To make the same thing working, you have to emit changed copy of object to parent component via Output binding like [(appData)]="data" (it uses EventEmitter to emit data to parent compoent).
AppComponent Template
<app-header [appData]="data" ></app-header>
<list-todo [(appData)]="data"></list-todo>
ListTodoComponent
@Component({
selector: 'list-todo',
template: `
<ul>
<li *ngFor="let item of appData">{{item}}</li>
</ul>
<button (click)="clear()">Clear</button>
`
})
export class ListTodoComponent {
@Input() appData;
@Output() appDataChange: EventEmitter<any> = new EventEmitter<any>();
clear(){
this.appData = [];
//this emit is important to send data back to parent.
//make sure you should have `Change` prefix to bounded value, like `appData` + `Change` = `appDataChange`,
//which ultimately saves few lines of code.
this.appDataChange.emit(this.appData);
}
}
Demo Here