title: how to use EventEmitter in angular7
body: <p>i define my component in one file and i want to send data form parent to child component in parent function is work properly but eventEmitter not emit </p>
  
  <p>this is my component file have two component</p>
  
  <pre><code>import { Component, OnInit, Inject ,EventEmitter,Output} from '@angular/core';
      import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
  
  export interface DialogData {
      name: string;
  }
  
  @Component({
      selector: 'app-new-time-register',
      templateUrl: './new-time-register.component.html',
      styleUrls: ['./new-time-register.component.scss']
  })
  export class NewTimeRegisterComponent implements OnInit {
  
      constructor(public dialog: MatDialog) { }
  
      ngOnInit() {
      }
  
      openDialog(modal:string): void {
          const dialogRef = this.dialog.open(RegisterDialog, {
              width: '480px',
              data: {name: modal}
          });
      }
  
      testEvent(value){
          console.log(value,"OOOOOOOOOOOOOOOOOOOO");
      }
  }
  
  @Component({
      selector: 'register-dialog',
      templateUrl: 'register-dialog.html',
      styleUrls: ['./new-time-register.component.scss']
  })
  export class RegisterDialog{
  
      constructor(
          public dialogRef: MatDialogRef&lt;RegisterDialog&gt;,
          @Inject(MAT_DIALOG_DATA) public data: DialogData) {}
      showAllPersons: Boolean = false;
      onNoClick(): void {
          this.dialogRef.close();
      }
  
      @Output() testEmit = new EventEmitter&lt;string&gt;();
  
      testEventEmitter(){
          console.log('TTTTTTTTTTTTTTTTTT');
          this.testEmit.emit("Test EventEmitter");
      }
  }
  </code></pre>
  
  <p>this is register-dialog.html file </p>
  
  <pre><code>&lt;span class="panel-title" (click)='testEventEmitter()'&gt;Computicate Trial Account Manager&lt;/span&gt;
  </code></pre>
  
  <p>here is my child app-new-time-register html file</p>
  
  <pre><code>&lt;register-dialog (testEmit)='testEvent($event)'&gt;&lt;/register-dialog&gt;
  </code></pre>
  
  <p>here is a child component</p>
  
  <pre><code>testEvent(value){
          console.log(value,"OOOOOOOOOOOOOOOOOOOO");
      }
  </code></pre>