What is the best way to propagate changes in the input model class from a child component to its parent in Angular 13?
Child Component
export class ChildComponent implements OnInit {
@Input() mdlInData: any;
@Output() mdlOutData = new EventEmitter<any>();
ngOnInit(): void {
this.mdlInData.subscribe((data) => {
this.mdlOutData.emit(this.mdlInData);
});
// These are the values that will also change in the HTML -> using TWO-WAY binding
this.mdlInData.id = 1;
this.mdlInData.Name = "Test";
this.mdlInData.phone = ['7867878', '768689678'];
//... More Properties
}