OutPut Decorator Simple Example

Faisal Ahmed - Aug 19 - - Dev Community

App.component

<h1 style="color: blue;">I am parent= {{title}}</h1>

<h2 style="color: red;">Data is coming from Child to Parent=  {{comingFromChildData}}</h2>

<app-child (updateDataEvent)="sendFunc($event)"></app-child>
Enter fullscreen mode Exit fullscreen mode
  title: any = "Hello Parent";
  comingFromChildData: any;

  sendFunc(item: any){
    console.log("I am from child data = ", item);
    this.comingFromChildData = item;
  }
Enter fullscreen mode Exit fullscreen mode

Child.component

<h2>I am child!</h2>
<button (click)="updateDataEvent.emit(myChildData)">Update Data</button>
Enter fullscreen mode Exit fullscreen mode
import { Component, Output, EventEmitter } from '@angular/core';
Enter fullscreen mode Exit fullscreen mode
   @Output() updateDataEvent = new EventEmitter<any>();

  myChildData: any = "ami dusto";
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player