<h1style="color: blue;">I am parent= {{title}}</h1><h2style="color: red;">Data is coming from Child to Parent= {{comingFromChildData}}</h2><app-child(updateDataEvent)="sendFunc($event)"></app-child>
title:any="Hello Parent";comingFromChildData:any;sendFunc(item:any){console.log("I am from child data = ",item);this.comingFromChildData=item;}
Child.component
<h2>I am child!</h2><button(click)="updateDataEvent.emit(myChildData)">Update Data</button>
Top comments (0)